Finding applications (Was: Smile - new window with propertie
Finding applications (Was: Smile - new window with propertie
- Subject: Finding applications (Was: Smile - new window with propertie
- From: email@hidden
- Date: Tue, 21 Nov 2000 20:25:20 -0500
On Mon, 20 Nov 2000 15:54:32 -0500, "Vince Jelenic" <email@hidden>
asked,
>
Let me see if I get it so far. just digging.
>
>
If app "XY" is already running, then applescript can tell application "XY" to
do whatever.
>
This works flawlessly, right ?
Right. But watch out for users that rename the application.
>
if app XY is not yet running, then applescript does not know which app you
>
refer to. If you run the script, it will ask for location,
>
If you compile script after finding location, it will then KNOW the
>
location for next time it's run.
>
move script to another machine, and you have to locate the app again.
>
This is the dreaded scenario?
Yes.
>
I've held off implementing applescript for quite some time due to it's
>
reduced portability between machines led by this glitch.
>
especially run-only apps which must automate any portions of workflow.
>
I assume it has not yet been solved.
>
However, kinda reminds me how powerful frontier was. this process was a
>
one-liner, basically , in that language .
>
>
with objectmodel, qxp
>
launch()
>
>
or simply launch.usingID("XPR3") and quark is launched
>
>
Is the differenct because Frontier speaks directly to the sytem while
>
Applescript must go through finder ?
Yes. AppleScript doesn't have direct access to the desktop database. But it
usually works, except in cases where there are more than one application with
the same ID. (Acrobat vs. Acrobat Reader, for example).
>
I have to do allthis stuff above to get applescript to work across macs.
>
>
The question is , why isn't the following line possible with applescript,
>
or why can't it be ?
>
launch every application whose type is "APPL" and creator is "XPR3" (or
>
backwards...)
>
It's a hit/miss for me to knowing when a script will run on any given
>
machine as I move about the office. gotta be a better way.
The "launch by creator" and "tell by variable" methods described in the
AppleScript Sourcebook
http://www.applescriptsourcebook.com/tips/launchbycreator.html
http://www.applescriptsourcebook.com/tips/tellbyvariable.html
John Delacour also provides information in
http://members.tripod.co.uk/scripting/applescript/doubletell.html
Note that in AppleScript under Mac OS 9, "using terms from" is available to
replace the "double tell". In that case, all you should need is launch by
creator, followed by a "using terms from application "xxx" ' for compiling,
surrounding a "tell x" block to tell the application you just launched by
creator.
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden