Run AppleScript on startup (background)

When saving the script in the script editor, save as an application bundle, then add it to the startup items in login system preferences:

alt text

If you want it to run in the background, you can use iBackground Scripts, a free tool to make applescripts run in the background.

alt text


I know your question is about running an Apple Script, but if all the script is doing is running /usr/local/bin/wol every 2 minutes, a simpler solution might be to use a launch daemon?

Either in /Library/LaunchDaemons if it's to run continuously even without a user logged in, or in ~/Library/LaunchDaemons to run per user (bearing in mind there could be more than one instance running if you've got more than one user logged in).

At least you don't have to worry about popup windows getting in the way.


As an alternative to the AppleScript way, I typically use launchd for handling things like this. launchd is customizable and very powerful.

http://developer.apple.com/MacOsX/launchd.html