Created
April 29, 2012 09:36
-
-
Save roxlu/2549033 to your computer and use it in GitHub Desktop.
Keep application running, auto restart on crash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Thanks Kris! Nice to keep track of these here :>
For people (like myself) who are more confident with bash script
!/bin/bash
while true
do
using open to get focus
open -a empltyExample
sleep 10
done
Change the default program for scripts to terminal if you want to use it with autostart
Or you could use Lingon on Mac OS X. It basically puts an xml file with the right settings in ~/Library/LaunchAgents
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The windows version:
:begin
start /WAIT emptyExample.exe
timeout /T 10
Goto begin
add this into the registry to avoid crash messagebox
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting]
"ForceQueue"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\Consent]
"DefaultConsent"=dword:00000001