• 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: getting application running information.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting application running information.


  • Subject: Re: getting application running information.
  • From: Paul Berkowitz <email@hidden>
  • Date: Fri, 24 May 2002 00:57:49 -0700

On 5/24/02 12:30 AM, "ben" <email@hidden> wrote:

> Hi$
>
> How can I check if a specific application is running? I only want to execute
> a given function of my script if that application is running either in the
> background or the foreground. How am I to go on about this?
>
tell application "Finder" to set procs to name of every process

if procs contains {"Application Name"} then...


If the application on question has different names in different versions,
then first learn what its 4-character creator type is if you don't know it:

tell application "Finder" to set creaType to creator type of process
"Application Name" --(if it's running, or else:

tell application "Finder" to set creaType to creator type of file
"MacHD:A Folder:Application File" )
)

and then use this:

tell application "Finder" to set creaTypes to application file id of
every application process

if creaTypes contains {"XXXX"} then... -- use app's creator type


The creator type is case-sensitive.



--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >getting application running information. (From: ben <email@hidden>)

  • Prev by Date: Re: Getting Font Usage list from Quark?
  • Next by Date: Re: getting application running information.
  • Previous by thread: getting application running information.
  • Next by thread: Re: getting application running information.
  • Index(es):
    • Date
    • Thread