• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to tell if an app is launched
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >How to tell if an app is launched (From: Gil Dawson <email@hidden>)

  • Prev by Date: Excel autorecover
  • Next by Date: Re: AS, wIP and 10.4.3: nothing's changed...
  • Previous by thread: How to tell if an app is launched
  • Next by thread: Excel autorecover
  • Index(es):
    • Date
    • Thread