Re: Is app running?
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