I’m new to Automator, and would like to know if there is a way to check to see if a specific app is still running, and if not launch it.
I’m trying to keep my 3D rendering server/clients running (even if they crash or someone accidently quits the app). I’d like my Automator script to periodically check to make sure the app didn’t crash or quit so I don’t have to stay up all night “babysitting” the render
It’s seems like a perfect task for Automator, but I can’t seem to find a action that fits.
You can use iCal to schedule launching an automator app. Create a new event in iCal and have it repeat as often as needed. For the alarm choose your automator app. In your automator app put the following applescript.
tell application "System Events"
if ((get name of the processes) does not contain "System Preferences") then
tell application "System Preferences"
activate
end tell
end if
end tell
Just change “System Preferences” to the name of the app you want to launch. Repeat the script for each app you need to launch. It is also possible to do this to a remote machine if needed.
a better solution than an automator workflow is a single applescript with idle handler.
Change the properties to the values you need.
Then save the script as application with option stay open und run it.
property appList : {"iTunes", "iPhoto", "iCal"}
property interval : 10 * minutes
on idle
tell application "System Events" to set processList to name of processes
repeat with i in appList
if i is not in processList then launch application i
end repeat
return interval
end idle