3 Replies Latest reply on Jul 29, 2009 4:13 AM by Muppet Mark-QAl63s

    Get pasteboard items

    Peter Bossens Level 1

      How can I get the pasteboard items using Applescript in InDesign CS2?

      I want to inspect the properties of these items, and based on this, delete some of them.

       

      Thanks,

      Peter

        • 1. Re: Get pasteboard items
          Muppet Mark-QAl63s Level 4

          Peter, Im new to both using ID and trying to script it so Im not sure what kind of milage you will get from this. This works for me with a very basic test document. The Idea being that page items that enter the bounds of a page have a parent class of 'page' where as page items that do NOT enter the bounds a page get a parent class of the 'spread' you will need to do some testing of your own.

           

          tell application "Adobe InDesign CS2"

          activate

          set PBI_List to {}

          tell document 1

          repeat with i from 1 to (count of spreads)

          tell spread i

          repeat with j from 1 to (count of page items)

          if class of parent of page item j as text = "spread" then

          set end of PBI_List to page item j

          end if

          end repeat

          end tell

          end repeat

          repeat with This_PBI in PBI_List

          select This_PBI

          delay 1

          delete This_PBI

          end repeat

          end tell

          end tell

          PBI_List

          • 2. Re: Get pasteboard items
            Peter Bossens Level 1

            Mark,

             

            Perfect, this trick works perfect.

            And it also allows me to inspect certain properties of objects in the Pasteboard-list before deleting them.

            Thanks!

             

            Peter

            • 3. Re: Get pasteboard items
              Muppet Mark-QAl63s Level 4

              Glad that it worked for you too. Only the second time i've looked inside the app's dictionary… Wow there's a lot in that i've got to learn!!!