Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 any way to automatically run a script on suspend/resume (i.e. when I close the lid, or after opening it) under Mac OS X 10.4?

share|improve this question

migrated from Jun 29 '12 at 16:41

This question came from our site for professional and enthusiast programmers.

More current answers here:… .... – jcollum Nov 10 '12 at 20:54
up vote 3 down vote accepted

Maybe try Sleepwatcher. Can't vouch for it, but found it after following Kevin's tips:

SleepWatcher 2.0.5 (now compatible with Mac OS X 10.5 “Leopard”) is a command line tool (daemon) for Mac OS X that monitors sleep, wakeup and idleness of a Mac. It can be used to execute a Unix command when the Mac or the display of the Mac goes to sleep mode or wakes up or after a given time without user interaction. It also can send the Mac to sleep mode or retrieve the time since last user activity.

share|improve this answer

Depending on the problem you're trying to solve, launchd might work. It will run tasks that were scheduled while the machine is asleep when it wakes up. It's also smart enough to only run one instance of the task if several intervals have passed while the machine was asleep.

See Getting Started with launchd from Apple.

share|improve this answer

I believe SleepWatcher can provide the functionality you are looking for.

share|improve this answer
rampion@ has already mentioned this – Rishi Dua Dec 8 '15 at 9:32

You must log in to answer this question.

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