1 Reply Latest reply on Apr 6, 2009 11:34 PM by sstanleyau

    Error when compiling AppleScript for CS2, need help

      I've recently started learning AppleScript, and while I'm no stranger to programming I'm a little lost when it comes to errors like this one. I have both InDesign CS2 and InDesign CS3 installed so I'm not sure if my problem is caused by that, they were installed before I started working on this mac. I've also been recently upgraded from Tiger to Leopard, in case that might be a probable cause.

       

      Basically, my problem stems from this:

      tell application "Adobe InDesign CS2"
          get active document
      end tell
      

       

      When I try to compile this I get a Syntax Error that says "Expected end of line but found class name." and highlights "document". I've also had problems trying to use things like "page 1" or "view preferences" with similar errors. With the case of things like "page 1" I've had to replace it with "item 1 of pages" to get it to compile.

       

      If I change it to "Adobe InDesign CS3" it works fine, but I need to compile for CS2 for backwards compatability. Strangely, this method works:

      set indesign to application "Adobe InDesign CS2"
      tell indesign
          using terms from application "Adobe InDesign CS3"
              get active document
          end using terms from
      end tell
      

      Does this mean my CS2 dictionary is broken? I can view it fine from the Script Editor, and I've seen things like "active document" used in example scripts, so this syntax error is confusing me.