Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

AppleScript to test if application is running (See related posts)

By name:
tell application "System Events" to (name of processes) contains "iTunes"


By creator type, in case it might have a version # appended:
tell application "System Events" to (creator type of processes) contains "InDn"


Grab creator type dynamically like so:
tell application "Finder" to creator type of (selection as alias)


From http://applescriptsourcebook.com/viewtopic.php?pid=46830


Comments on this post

deweller posts on Jul 20, 2007 at 13:39
Here is a an example of how to use this:


if appIsRunning("iChat") then
        tell application "iChat"
                set status to available
        end tell
end if


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

You need to create an account or log in to post comments to this site.


Related Posts