If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
Is there a way to check if an application is open before you start talking to it, so if it is not open, your script will do something else instead of launching the app?
Originally posted by l008com: Is there a way to check if an application is open before you start talking to it, so if it is not open, your script will do something else instead of launching the app?
Yes.
Under Mac OS X, 'System Events' keeks a track of open apps. The Finder does the same under presious OS versions:
Code:
tell application "System Events" -- or Finder under 9.x
set runningApps to name of every process
if runningApps contains "Some App"
display dialog " Some App is already running"
else
display dialog "Nope."
end if
end tell
Clearly, you change the "Some App" check with the name of the app in question.
Gods don't kill people - people with Gods kill people.