Re: Scripting for multiple InDesign versions
Re: Scripting for multiple InDesign versions
- Subject: Re: Scripting for multiple InDesign versions
- From: Stan Cleveland <email@hidden>
- Date: Wed, 27 May 2009 17:44:03 -0700
- Thread-topic: Scripting for multiple InDesign versions
On 5/27/09 4:41 PM, "Tim Mansour" wrote:
> Hello to all.
>
> I know this topic has been touched on many times, but I struggled to
> find a suitable answer in the archives.
>
> I'm trying to modify an InDesign script to allow for situations where
> users have multiple versions of InDesign installed; specifically, this
> can be either or both of CS3 and CS4. The script is run from within
> FileMaker and can be altered at runtime to change the target (I
> will obviously test the script works in both versions of ID).
>
> It appears that InDesign is using "com.adobe.InDesign" as its bundle
> identifier regardless of version, so it's not possible to use that to
> identify which version to target in a script. I was hoping I could
> somehow check the user's system to determine which version(s) of ID
> were present; if CS3 and CS4 are both installed I would present a
> dialog to ask which one to use, otherwise use whichever is installed.
>
> So does anyone have suggestions as to how to reliably (a) locate and then (b)
> target whichever InDesign is installed? I'm expecting that searching
> for paths might be the way to go.
Tim,
I know you can get the names of *running* applications:
tell application "System Events"
set appList to name of application processes
end tell
--> {"loginwindow", "Spotlight", "Dock", "Adobe InDesign CS3", ...}
Back in July of 2007, there was a short thread on this list named "Detect if
application is installed." It does NOT appear to be in the archives on the
Apple site (!). However, the pertinent bits from posters John Pugh and Peter
Bunn are these:
tell application "Finder"
exists application file "Mail" of folder "Applications" of startup disk
exists application file id "MMan"
exists application file id "com.apple.TextEdit"
end tell
Peter reported that some of the above returned true, some false, so test to
determine what will work for you in your situation.
Once the apps are identified, you can easily target the correct version by
using its full path, not just its name, when 'telling' the application:
tell application "Disk:Applications:Creative Suite 3:Adobe InDesign CS3"
-- do whatever
end tell
tell application "Disk:Applications:Creative Suite 4:Adobe InDesign CS4"
-- do whatever
end tell
This works even when the different applications have identical names (such
as two versions of Microsoft Excel).
HTH (at least a little),
Stan C.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden