Re: Getting running status of an application
Re: Getting running status of an application
- Subject: Re: Getting running status of an application
- From: Cornwall <email@hidden>
- Date: Thu, 30 Aug 2001 17:28:44 -0700
At 9:29 AM +1000 8/31/01, Phillip Hall wrote:
>
Hi,
>
>
I need to know if an application is running before doing a Tell block which
>
quits the application.
>
>
Is there a way to find the running status of an application?
Here is one I modifies after OS 9.1 changed the rules slightly
tell application "Finder"
set procList to creator type of every process
set isItRunning to (procList contains <<class BOBO>>) or (procList contains "BOBO") --is Claris/AppleWorks running?
if not isItRunning then --if not (running), alerts user to launch AppleWorks and quits this applet
display dialog "AppleWorks/ClarisWorks must be running." buttons {"OK"} ==>
default button "OK"
tell me to quit
return
end if
set myWorks to (first process whose creator type is "BOBO") as <<class psn >> ==>
--if AppleWorks is running, get a reference to the users running app
end tell
-- "<<" and ">>", must be replaced with chevrons (ASCII characters 199 and 200).
-- "==>" must be replaced by 'option-L', the continuation character.
HTH
Corny