2 Replies Latest reply on Mar 11, 2010 4:07 PM by nicoboss76

    Applescript use Document size information

    nicoboss76

      HI ALL,

       

      I am trying to put together a script that would fill up a slug with document size information:

       

      - Let say my document is 8.5"W x 11" H
      - Let say that my slug has a "document size" area with placeholder text, like DocWidth x DocHeight

       

      The script would do a find and replace of "DocHeight" by the value of the Height of my document.

       

      Here is an abstract of my applescript as it stands:

       

      ......... (there is more before this section: I set document size to a random size, 6"x6", then tells it to put some bleed, then a slug area, then to import my slug that is a snippet)

       

      tell application "Adobe InDesign CS4"
          set myWidth to page width of document preferences of myDocument
          set myHeight to page height of document preferences of myDocument
          set find text preferences to nothing
          set change text preferences to nothing
          set find what of find text preferences to "DocHeight"
          set change to of change text preferences to myHeight
          tell active document
              set myFoundItems to change text
          end tell
      end tell

       

      Now my script works, but it gives me the following error:

      Adobe InDesign CS4 got an error: Invalid value for set property 'change to'. Expected string or nothing, but received 6.0.

       

      Does anyone know waht I am missing here ?

       

      Thank you for any help!!!!