Do you really want to determine these things at the runtime? I mean
if you already know the location of different versions of an applications on
the disk, you can specify the path in the script itself and it will work.
property QXPLocation : "Panther:Applications:QuarkXPress61:QuarkXPress
Passport.app" -- the absolute path of your apps
tell application QXPLocation
-- your statements.
end tell
Good Luck!!!
*Question
1*: I have this little script here I run in OS X 3.5 to look for currently
running Quark versions:
tell app "System Events"
set procL to every process whose creator type is "XPR3"
repeat with p in procL
try
display dialog (file of p) as text
-- If (file of p) equals some predetermined path then I've found what I'm
looking for and exit repeat.
on error errmsg
display dialog errmsg
end try
end repeat
end tell
If I have Quark 4 and no other Quark versions running, I get what I expect,
something like "Macintosh HD:Applications (Mac OS 9):QuarkXPress
4.1:QuarkXpress", and likewise if I have Quark 5 running and no other
Quarks I get the correct path to the Quark 5 application.
However, if I have them both running, it loops twice, but both times I get the
path for whichever process was started first, e.g., if I start Quark 5, then
start Quark 4, and then run this script, then both times the Quark 5 path is
displayed. Can anyone please shed any light on this?
*Question 2*: Once I've found the Quark process I'm looking for, what is the
correct way of opening the document in the correct process, seeing that more
than one process may have the same name? (and Classic vs. OS X - is the syntax
the same?)
tell app "System Events" ...or... tell app "Finder"
tell process p ... or... tell process (name of p) ...or... ???
open alias myDoc
end tell
end tell
Thanks very much...
- Dan