Re: check a process
Re: check a process
- Subject: Re: check a process
- From: Nigel Smith <email@hidden>
- Date: Tue, 23 Dec 2003 09:45:49 +0000
On 18/12/03 12:25, "Jim Brandt" <email@hidden> wrote:
>
Specifically, I want to know if the Classic environment is running
>
before I try to launch a OS9 application.
If you know a particular process always runs in Classic, you could test for
that. For example, my Classic has the Suitcase extension installed so I can
do:
tell application "System Events"
if (name of every process as text) contains "Suitcase 9" then
return true
else
return false
end if
end tell
Otherwise you could use the shell -- note that the first "grep" finds all
matches in the ps listing, possibly including the "grep" command itself, so
the second "grep" omits all "grep" commands...
The "if...then" part is all one line:
if (do shell script "ps -auxww | grep TruBlueEnvironment | grep -v
grep") = "" then
return false
else
return true
end if
HTH,
Nigel
_______________________________________________
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.