Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
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

Yes, you can do what you need with AppleScript.

First, Open AppleScript Editor (/Applications/Utilities/AppleScript

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

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.