Skip to content

Instantly share code, notes, and snippets.

@roxlu
Created April 29, 2012 09:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roxlu/2549033 to your computer and use it in GitHub Desktop.
Save roxlu/2549033 to your computer and use it in GitHub Desktop.
Keep application running, auto restart on crash
on appIsRunning(appName)
tell application "System Events" to (name of processes) contains appName
end appIsRunning
on makeActive(appName)
tell application appName
activate
end tell
end makeActive
repeat
if appIsRunning("emptyExampleDebug") then
else
do shell script "open -a /Users/diederick/Documents/programming/c++/of/app/projects/peepee/game/bin/appdebug.app/Contents/MacOS/appDebug"
end if
makeActive("appDebug")
delay 25
end repeat
@vormplus
Copy link

Or you could use Lingon on Mac OS X. It basically puts an xml file with the right settings in ~/Library/LaunchAgents

http://www.peterborgapps.com/lingon/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment