ScriptSaver: screensaver-triggered AppleScript

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.

ScriptSaver configuration panel
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.

Download ScriptSaver.

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

  1. Monty Sher
    Posted January 2, 2009 at 11:40 am | Permalink

    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?

  2. Posted January 2, 2009 at 11:46 am | Permalink

    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.

  3. Adam Bell
    Posted January 4, 2009 at 11:59 am | Permalink

    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

  4. Matthew
    Posted January 6, 2009 at 1:19 pm | Permalink

    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

  5. Doug Korns
    Posted January 11, 2009 at 1:17 am | Permalink

    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?

  6. Posted January 11, 2009 at 9:01 am | Permalink

    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.

  7. Clayton
    Posted April 8, 2009 at 10:31 am | Permalink

    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!

    • Stephen Howell
      Posted June 25, 2009 at 6:40 pm | Permalink

      @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

  1. By ScriptSaver 2.9 « scattershot genius; on November 30, 2007 at 10:24 pm

    [...] PDF to Gerber and NC Drill formatstxt2booklet: Generate directories with Perl and XHTMLScriptSaver: Run AppleScripts at screensaver activation timeQuotes « [...]

  2. By Mac Lab Rat - GGP #71: Horse Kennel | K's Weblog on December 8, 2007 at 12:29 pm

    [...] 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 [...]

  3. By ScriptSaver 2.10 « scattershot genius; on April 24, 2008 at 8:18 pm

    [...] PDF to Gerber and NC Drill formatstxt2booklet: Generate directories with Perl and XHTMLScriptSaver: Run AppleScripts at screensaver activation timeQuotes « Anatomy of a [...]

  4. By ScriptSaver 2.10 on April 25, 2008 at 12:02 pm

    [...] Website Download ScriptSaver These icons link to social bookmarking sites where readers can share and discover new web pages. [...]

  5. [...] ScriptSaver [...]

  6. By Picks from MBW 90: Flippin’ the Bird on May 21, 2008 at 1:15 pm

    [...] at http://swannman.wordpress.com/ for free from Andy [...]

  7. [...] PDF to Gerber and NC Drill formatstxt2booklet: Generate directories with Perl and XHTMLScriptSaver: Run AppleScripts at screensaver activation timeQuotesBand names « [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*