Re: Targeting an application where there are two versions?
Re: Targeting an application where there are two versions?
- Subject: Re: Targeting an application where there are two versions?
- From: "Marc K. Myers" <email@hidden>
- Date: Fri, 20 Apr 2001 13:23:13 -0400
- Organization: [very little]
>
Date: Fri, 20 Apr 2001 11:55:37 +0200
>
From: Brennan Young <email@hidden>
>
Reply-To: email@hidden
>
Organization: Magic Lantern
>
To: applescript-users <email@hidden>
>
Subject: Targeting an application where there are two versions with the
>
same name
>
>
Hi folks,
>
>
I'm trying to test my applescripts with the beta of Livestage Pro 3.
>
These are scripts which I compiled for LiveStage Pro 2 and I can't seem
>
to target the new app.
>
>
Here's my bare bones example:
>
>
tell application "LiveStagePRO"
>
activate
>
end tell
>
>
I can understand why it's targeting the version 2 app with this script
>
because they have the same name. What I don't understand is that when I
>
do this:
>
>
tell application "LiveStagePRO_" -- underscore inserted deliberately
>
activate
>
end tell
>
>
... I get the 'where is' dialog, so I select the version 3 app, the app
>
name in the script text changes, as expected, and I would assume this is
>
giving me an alias to the version 3 app, but it still targets the
>
version 2 app. What's going on here?
>
>
The only way I can get this to work is to rename one of the apps, which
>
is undesirable, or if I go through the Finder:
>
>
tell application "Finder"
>
set LSP to (application file id "LS30") as string
>
end tell
>
>
tell application LSP
>
activate
>
end tell
>
>
This seems to work, but I'd prefer it if I could rely on the alias form
>
so that the script works with both versions, depending on which one is
>
installed. (Each version has a different creator type.) I suppose I can
>
deal with those people who have both versions in some way if I can work
>
out what's happening here.
>
>
Can anyone help out?
You can use a complete path to the application file in your tell
statement. That should get you where you want to go. In general, when
there are two apps with the same signature, the one most recently
compiled is selected when you do a tell by name or app ID.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[4/20/01 1:22:58 PM]