ScriptSaver is a Mac OS X screensaver which runs AppleScripts when it activates and deactivates. A common use for this is to perform periodic maintenance tasks, run cleanup scripts on kiosk machines, or simply update iChat status when the computer is idle.

The ScriptSaver configuration panel
To install ScriptSaver, copy ScriptSaver.saver to the Screen Savers folder in the Library folder of your home directory. Source code is included.
If you’re interested in seeing what can be done with ScriptSaver, example scripts are available to do things like log out the current user, play/pause iTunes, set an iChat away message, and more. You can download these here.

8 Comments
Thanks for this useful tool. I have set it to run a script which activates Front Row to display photos from the iPhoto library. Sometimes the display freezes when starting with a particular set of photos. Do you have any idea why? Another question: is there a set period of time at which ScriptSaver deactivates?
Hi Monty — I’m not familiar with the Front Row problem you describe. Does rebuilding the iPhoto library resolve the issue? Here’s how to do so:
http://support.apple.com/kb/HT2638
ScriptSaver’s deactivation event is called when the operating system decides to cancel the screen saver (generally because of keyboard input or a mouse movement)… it won’t deactivate itself.
You might be able to deactivate the screensaver by letting your activation script quit the ScreenSaverEngine process after a given amount of time has elapsed, however.
Great stuff. I had been using the Scenario Preference Pane which is no longer published and wasn’t entirely satisfied because it triggered on Sleep. This is exactly what I want — triggers a script that uses a Sophisticated Circuits PowerKey Pro 650 to turn a bunch of stuff on and off when the screen saver comes on or goes off.
http://www.sophisticated.com/products/powerkey/pkp_650.html
I’m noticing that the screen saver is periodically deactivating without keyboard or mouse movement. What other types of events can cause the OS to deactivate the screen saver? Is there a way to increase logging to record the event that caused it?
TIA
The Configure ScriptSaver screen shot above the comments on the web page shows version 2.8 (in a window, not a drop-down sheet), while the Download ScriptSaver link on the same page only gets you ScriptSaver version 2.1!
I noticed that a screensaver, such as ElectricSheep, that normally runs on multiple displays, only shows on the main display after being passed control from ScriptSaver. Is that a bug to be fixed? Or fixed in v2.8 perhaps?
Doug, thanks for trying ScriptSaver! The download link points to version 2.10 — there have been two versions since 2.8, but none big enough to warrant a jump to 3.0.
I haven’t looked at supporting multiple displays yet… I believe it’s possible, just not yet implemented. ScriptSaver isn’t under active development, but I’ve made a note to look at that next time I make changes in the codebase.
This sounds very useful.
Do you know if the reverse is possible?
I’m trying to write an Automator app that wakes a remote machine from screensaver, loads a webpage and takes a screencap.
I can’t figure out the part of deactivating the screensaver by Automator.
Any suggestions? Thanks!
@Clayton
Run an applescript within the automator action that sends a key command to stop the screensaver like any other keystroke would.
Example:
tell application “System Events” to keystroke tab using command down
or
tell application “System Events” to keystroke “n” using {command down, shift down} — get all new mail in Mail.app
7 Trackbacks
[...] PDF to Gerber and NC Drill formatstxt2booklet: Generate directories with Perl and XHTMLScriptSaver: Run AppleScripts at screensaver activation timeQuotes « [...]
[...] First up this week is a Screen Saver application called ScriptSaver by Matt Swann. I call this a Screen Saver Application because though it’s launched by your [...]
[...] PDF to Gerber and NC Drill formatstxt2booklet: Generate directories with Perl and XHTMLScriptSaver: Run AppleScripts at screensaver activation timeQuotes « Anatomy of a [...]
[...] Website Download ScriptSaver These icons link to social bookmarking sites where readers can share and discover new web pages. [...]
[...] ScriptSaver [...]
[...] at http://swannman.wordpress.com/ for free from Andy [...]
[...] PDF to Gerber and NC Drill formatstxt2booklet: Generate directories with Perl and XHTMLScriptSaver: Run AppleScripts at screensaver activation timeQuotesBand names « [...]