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.
Update: now supports 64-bit Snow Leopard systems!

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.

31 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
Just upgraded to Snow Leopard, and ScriptSaver doesn’t work. Any possibilities that it will be upgraded to work with 10.6?
Definitely — I’ll try to recompile it for 10.6 this week.
Can’t wait for the Snow Leopard-compatible Scriptsaver!
I’ve updated ScriptSaver to include a version that’s compiled for 64-bit Snow Leopard systems. Try it out and let me know if it works for you!
Just tried 2.11 on my snow leopard system, and once installed in Library/Screen Savers, it comes up saying “cannot be used on your system”. Am I doing something wrong? I’ve tried 32 and 64 bits versions…
Hmm — my beta testers verified that ScriptSaver 2.11 works on 64-bit systems running Snow Leopard, in both 32- and 64-bit kernel mode. James, I’ll email you and see if we can’t figure out what’s going on here…
Matt, I ran into the same problem that James is seeing above. I’m running 10.6.1 in 32-bit. Let me know if there’s anything I can do to help.
Hi Jehan — I’m running 10.6.1 in 32-bit as well and am able to use the ScriptSaver.saver in the latest .zip file available above… could you try deleting ScriptSaver.saver from your Screen Savers directory and re-installing?
Hi,
As my iMac will never sleep I found your great piece of software. THANK YOU
I now wrote an AppleScript which tells the Mac to sleep after 15 minutes. If I start my script with “delay 900″ I see 15 minutes of black screen. When I do it in “asynchronous” mode” I see the preset screen saver but as the script already started I am N O T able to stop the script anymore and it sleeps my Mac after 15 minutes!?
When I set it to “NOT asynchronous mode” I can CANCEL the script using the ESC-key.
Any idea how to interrupt a running script in “asynchronous mode”???
Thanks for your help
Manfred
@Manfred, that’s an interesting one… in “asynchronous mode” we fire off your AppleScript but then immediately start the screensaver without waiting for your script to finish.
I don’t know of an easy way to intercept keypresses while the screensaver is running… but what if you wrote a deactivation script that killed all currently-running Applescripts (using the command-line tool ‘kill’)?
Hi Matt,
this is a great app.
I just came here by googling around for a problem I am trying to solve in one of my own apps.
Eventually you are the right man to comment here:
http://stackoverflow.com/questions/1443243/launchagent-is-there-something-like-runatscreensaver
:-)
Cheers & keep up the good work,
Josh
Hi Matt,
you were right!!!
do shell script “killall ” & quoted form of (“osascript”)
did the job … I don’t know if this is a real perfect solution but it works so far :)
thanks for your help
Manfred
Matt, sorry it took a few days; I deleted ScriptSaver from my screensavers folder and re-installed it. Still no luck, though. It’s greyed out in the Screen Savers pref pane, and when I select it, I still get the same error.
Update: I worked with Jehan to track down the issue here. ScriptSaver 2.12 is now more compatible with certain systems and is available from the download link above.
ScriptSaver 2.12 reports the following error when selected in the pref panel:
Can’t load screen saver
Screen saver “ScriptSaver” did not load properly. Please select another screen saver.
Error: Can’t load bundle
I’m running OS 10.5.8, everything up to date. I’ve downgraded to a copy of 2.11 from my archives, which is still working perfect.
Okay.. I’ve updated ScriptSaver.zip to include the “old” binary from 2.11. Could you verify that it works on your machine?
(I tested 2.12 on a 10.5 system, so I’m not sure why it’s not working.)
Just downloaded your update and installed the “old” binary… works perfectly.
Hi Matt,
I love your program!! Great work!!!
I’m having an issue when selecting the RSS Visualizer as the screensaver to run after launching the script. It is displaying the default “Apple Hot News” feed rather than the feed I have selected in the RSS Visualizer settings (in other words, running RSS Visualizer outside of ScriptSaver displays the feed I want, but running RSS Visualizer through ScriptSaver displays the “Apple Hot News feed”).
Any suggestions?
Great question Chris. By default, there’s no “easy” way for ScriptSaver to load all the info about the RSS Visualizer or other Quartz Composer screen savers… they aren’t traditional screensavers in the sense that they have code and a preferences file and all that. Right now I detect that it’s a .qtz file and do some special things to make it display on the screen.
I’m not real sure how the screensaver pref pane passes in preferences for the RSS Visualizer. If you have Apple’s free developer tools installed, you can duplicate the RSS Visualizer file (/system/library/screen savers) and change the default RSS feed URL to the one you want… if you want to go that route, let me know and I can give you step-by-step directions.
it seem’s that the download version is 2.10…
I would like my screensaver to alternate between 2 screensavers – a folder of photos & Marine Aquarium. Is there a way to do this.
Cheers & Thanks
Henry
I am trying to use scriptsaver to launch an iTunes visualizer as the screensaver like this article suggests here http://www.macosxhints.com/article.php?story=20040205044431199 but the problem is scriptsaver also launches a screensaver over top of the visualizer. even if “none” is selected it’s just a black screen. anyway to just launch the script and othing else?
Thanks for the great freeware product! I’ve used it in 2005 to install a screensaver for Gemini Observatory. It really just runs an applescript that launches a Director projector.
Back then I was able to hack (and I do mean hack, I know nothing about C or Xcode, just poked around until it worked) a default location for what was then called the “location” key. Now it looks like you’ve called it something else.
To make a long story short, I can’t seem to figure out how to hack this new version, and the old version doesn’t work anymore on Snow Leopard. Is there an easy way?
FYI – the end result is part of a giveaway educational product, a CD-ROM called Gemini Observatory Virtual Tour. I get paid to upkeep it (work for hire). If you’d like payment for it, let me know & I see if we could swing it. In any case I’ll be happy to send you a copy.
Thanks for considering this.
~Reed
9 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 « [...]
[...] PDF to Gerber and NC Drill formatstxt2booklet: Generate directories with Perl and XHTMLScriptSaver: screensaver-triggered AppleScriptQuotesBand namesPortfolio « Tolstoy [...]
[...] developer has also made some sample AppleScripts available for use with ScriptSaver. For my purpose I just [...]