Take the 2-minute tour ×

Is there easy way to ensure that some gui application is running (restart if it crashes)?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

Check out the script in msg 20 in this thread and modify it to the application you are interested in keeping alive.

It will help you create a Launch Agent to check and open when necessary.

This alleviates the need for an Applescript application running.


share|improve this answer
Awesome!!!!!!!! –  tig Nov 4 '10 at 3:12
add comment

Applescript might be the way to go with this one. This webpage outlines how to see if an application is running and this webpage outlines how to run an application and also how to perform an action based on criteria. Basically you would script it so that you loop a check to see if the app is running. If at any time it is not running, you start it. I'd draft out something for you but at this time I don't have a working Mac to test with.

share|improve this answer
add comment

Yes, you can do what you need with AppleScript.

First, Open AppleScript Editor (/Applications/Utilities/AppleScript Editor.app)

Then insert this code into the editor:

tell application "System Events"
        set running_apps to every application process's name
        if running_apps does not contain "TextEdit" then
            tell application "TextEdit" to activate
        end if
    end repeat
 end tell

Replace TextEdit with the application you want to watch. Then save this as an application and run the application you saved whenever you need to keep the application open.

Hope this helps!

share|improve this answer
add comment

Your Answer


