I have a script that will be used in multiple versions of InDesign. Rather than just break up the scripts and hard code the app names in, I thought it would be nifty to decide which version of ID to use on-the-fly. What I did was queried the running processes for InDesign versions, then allowed the user to select which InDesign they wanted to execute the script in. The script then dumps their chioce into a variable called ‘InDesignName’. I then call the application like this:
tell application InDesignName
activate -- or quit works well too!
end tell
But I can do only the basic things like activate and quit. Whenever I try to do stuff specific to the dictionary of the app I’m calling, it complains of a syntax error during compile. I am suspecting that AS, unaware of what I’m telling it to do, is only granting the app I plug into the ‘tell application’ command with the commands found in the Required Suite. Is there some way to get AS to recognize that I am trying to call a real app? Something like maybe casting the variable InDesignName into an application? Something like:
tell application (InDesignName as application)
....
end tell
Or have any of you come up with a better solution? And is that solution to just make 3 different scripts?