Re: Weird feature of "if it exists" or?
Re: Weird feature of "if it exists" or?
- Subject: Re: Weird feature of "if it exists" or?
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 15 Sep 2003 09:54:24 -0700
On 9/15/03 9:13 AM, "Robert Poland" <email@hidden> wrote:
>
> ------------------------
>
> tell application "Finder" to get creator type of process "SETI@home_OSX"
>
> ------------------------
>
doesn't seem to be the cure for the main problem.
>
There are a number of ways to see if the app is running, but I need a
>
way to see if the app exists without causing a search for the app.
That was just meant for you personally to find out what the creator type is,
so that you could then go on to do what Nigel did. Nigel had to know that
the creator type is "Seti" which he probably found out by doing the above
(or getting it from 'Get Info'.) Some of the new Cocoa package-type apps
don't have creator types, but then they have "bundle identifiers' which you
can discover by a more elaborate process and still use the technique below
('application file id' still works with those). But SETI has been around for
a while so I'm sure it must have a creator type.
>
>
Nigel Garvey <email@hidden> came up with this
>
which seems to work. Not mentioning the app by name seems to be the
>
cure.
>
>
tell application "Finder"
>
if not ((some process whose creator type is "Seti") exists) then
>
if application file id "Seti" exists then open application file id
>
"Seti"
>
end if
>
end tell
But if you do need to script an app under these circumstances further than
just opening it, it's still possible, by setting a variable to the file path
and 'using terms from':
set setiAppPath to application file id "Seti" as Unicode text
using terms from application "SETI@home_OSX"
tell application setiAppPath
-- your script
end tell
end using terms from
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.