• 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: Is app running?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is app running?


  • Subject: Re: Is app running?
  • From: Bill Cheeseman <email@hidden>
  • Date: Fri, 06 May 2005 07:34:39 -0400

on 2005-05-05 7:44 PM, Brennan at email@hidden wrote:

> I need to find out whether a specific app (in this case
> QuickTime player) is running. At the moment I am using:
>
> tell application "Finder"
>   (application processes whose name contains "QuickTime Player") is {}
> end tell
>
> This works, but is there a way to do this without using the Finder? (And
> preferably without launching any other apps).

In Tiger, you can now use GUI Scripting to do this, at least with respect to
applications that have a user interface (i.e., their icons appear in the
Dock when running). Like this:

tell application "System Events"
   tell process "Dock"
      get value of attribute "AXIsApplicationRunning" of UI element
"QuickTime Player"  of list 1
   end tell
end tell

Watch for line wrapping there in the middle.

System Events and the Dock (like the Finder) are always running in a typical
setup.

For this and other examples of new GUI Scripting techniques available in
Tiger, download the free 30-day trial version of PreFab UI Browser 1.4 at
<http://www.prefab.com/uibrowser/> and look at the "UI Element Scripts
(PreFab)" folder. For example, it contains an example script showing how to
execute menu commands in Menu Extras (at the right end of the menu bar) in
Tiger.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes


 _______________________________________________
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

  • Follow-Ups:
    • Re: Is app running?
      • From: deivy petrescu <email@hidden>
References: 
 >Is app running? (From: Brennan <email@hidden>)

  • Prev by Date: RE: move all files also with no extension via shell command
  • Next by Date: Re: Nice Automator article on O'Reilly
  • Previous by thread: Re: Is app running?
  • Next by thread: Re: Is app running?
  • Index(es):
    • Date
    • Thread