Applescript: Check Application Is Running

Below is my Applescript example of how to check if an application is running, such as Finder.app, VLC.app, itunes.app, or something along those lines. Quite often I need to check if an application is running as part of my applescript, and so I use this little function / subroutine in applescript to test if the application is running:

on appIsRunning(appName)
    tell application "System Events" to (name of processes) contains appName
end appIsRunning

Example usage:

display dialog appIsRunning("Finder")

The above apple script example will show “true” in a popup dialog.

Related Posts:

  • No Related Posts
This entry was posted in Mac, Software, Tech Tips and tagged , , , , , , , , . Bookmark the permalink.

One Response to Applescript: Check Application Is Running

  1. Robert W√ľnsch says:

    It might be easier to do this:

    if application “Mail” is running then … end if

Leave a Reply

Your email address will not be published. Required fields are marked *