I have a script that needs to be used by users in which some have InDesign CS2 and some have CS3 - and there is a different bit of code needed for each version. I’m trying to figure out some code that will test for the existence of CS3, so that I can split the code appropriately.
I normally would do something like this with checking running processes, but from looking at Activity monitor, both Indesign CS2 & CS3 are a process called “Adobe InDesign C” - which makes me think I couldn’t accurately test for it…
The only thing I’ve thought of so far is to test for the existence of the App folders in the Applications folder and/or in the user library…but that seems a little cludgey…
tell app "Indesign"
get version of it
That’s not seeming to be very reliable…
Script Editor will rewrite “InDesign” to “Adobe InDesign CS3” on compiling, since my machine has CS3 on it.
I tried saving this as an app:
set inddApp to "InDesign"
tell application inddApp
set inddVersion to (get version of it)
display dialog inddVersion
hoping that it would be more generic at the compilation step, and tried it on a machine that only had CS2. It came up with a “Where is InDesign?” dialog box…which I don’t want to require the users to deal with…
I don’t if this works also with CS 2, it works at least with CS 3
tell application "Finder"
get name of application file id "com.adobe.InDesign"
How about if you look for both CS2 and CS3 inside a try statement?