# Run applescript when mac wakes?



## anilsen (Jun 20, 2003)

How can I make a handler in applescript on OS X that runs when my Ibook wakes from sleep? Is there a wake system event that makes it possible to write something like

on wake
  -- doing my stuff here
end wake


Regards

Anders


----------



## slur (Jun 24, 2003)

Here's a good starting point, a daemon that runs a shell script when the system sleeps or wakes:

SleepWatcher

Then make a simple shell script that runs the *osascript* or *open* command to execute an AppleScript.


----------



## anilsen (Jun 25, 2003)

I'll give it a shot. Would have been nicer though if Apple had implemented some solution for use with applescript for us who are not familiar with shell scripting. Well, I'll have to get that then!

Thanks for your reply.

Anders


----------

