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.
One Response to Applescript: Check Application Is Running