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.
I'm not sure why you're getting that error, but a couple of things:
Using "document 1" instead of "active document" is not a bad habit,
because there are cases where active document doesn't work.
When you compile the scripts, the version is somewhat irrelevant -- when
you go to run them, they look for a running application of the same creator
code, and use that. It's a bit like when you double-click on a document in
the Finder -- it doesn't matter what version of ID you made it in, it will
try to open in whatever version is running first.
Shane Stanley <email@example.com>
AppleScript Pro Sessions <http://scriptingmatters.com/aspro