Re: How to tell if an app is launched
Re: How to tell if an app is launched
- Subject: Re: How to tell if an app is launched
- From: Bill White <email@hidden>
- Date: Wed, 02 Nov 2005 21:26:51 -0500
- Thread-topic: How to tell if an app is launched
Title: Re: How to tell if an app is launched
On 11/2/05 8:00 PM, Gil Dawson <email@hidden> wrote:
I'm looking for a more compact way to tell whether an application is active. The following works, but seems unnecessarily cumbersome:
tell application "Finder"
set TElaunched to ((application processes whose name is "TextEdit")'s name as string)
end tell
if TElaunched is not equal to "TextEdit" then return
Is there something simpler?
Try this:
tell application "System Events"
if not (exists process "TextEdit") then return
end tell
Or, if you need to capture its status in a variable you could do:
tell application "System Events"
set TElaunched to exists process "TextEdit"
end tell
if TElaunched is false then return
HTH,
Bill
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden