I rely on Dropbox for syncing work files between two computes that are powered on 24/7. For some reason, Dropbox terminates (crashes or quits) after long periods of time, with no explanation. I just find later that the application is no longer running.

Is there a way I can get notified (e.g. via a popup) when a certain application terminates?

I'm thinking there might be a way for AppleScript to do this, but I'm unsure where to begin.

1 Answer 1


Quite easily with an Applescript:

    tell application "System Events"
        if name of every process does not contain "Dropbox" then display alert "Dropbox has crashed!"
    end tell
    delay 5
end repeat

You could replace "display alert" with tell application 'Dropbox' to launch ..to have it automatically restart if you desire.

Paste this into Script Editor. save it, and then you could add the script to your user's startup items for future use. The timing there may be a bit tricky though if the script starts before Dropbox - adding a delay 10 or something before the first repeat would solve this.

For future use, anything involving System Events is a great place to look for solutions to these kinds of meta-system-wide tasks.

  • Thank you very much! I have now implemented your solution so that it automatically restarts the application, and it seems to work great.
    – P A N
    Mar 7, 2016 at 17:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .