Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A script to create a 'new Mail messages' screen saver Apps
I often walk away from my desk (and computer) for a bit of time. When I get back, I have to interrupt the screensaver to see if I received any mail while I was away. I always wished the screensaver could just let me kow and save me the trouble of having to unlock my computer to find out. It turns out this is very simple in OS X. Here is what I did with a few minutes worth of learning AppleScript. (I am sure more experienced folks can find more elegant solutions.)

Here's the four-step solution:
  1. Create two image files, one called youhavemail.jpg and one called youhavenomail.jpg. My images are light blue text over a black background. The text says "You have mail" for the first file, and "No new mail" for the second file.
  2. Create a new folder, I called mine screensaverpix. I created the files and the folder in my top-level directory. If you put them somewhere else, modify the script below accordingly.
  3. Run the following AppleScript. You can compile it and run as an app at login if you would like:
    repeat
      tell application "Mail" to set TotalNumberofnewmessages to unread count of inbox
      if (TotalNumberofnewmessages is greater than 0) then
        do shell script "cp ~/youhavemail.jpg ~/screensaverpix/pix1.jpg"
        do shell script "cp ~/youhavemail.jpg ~/screensaverpix/pix2.jpg"
      else
        do shell script "cp ~/youhavenomail.jpg ~/screensaverpix/pix1.jpg"
        do shell script "cp ~/youhavenomail.jpg ~/screensaverpix/pix2.jpg"
      end if
      delay 70
    end repeat
  4. Set the Screen Saver tab of the Desktop & Screen Saver System Preferences panel to use the images in the folder you created in step two.
That's it. Any time you have more than 0 unread email messages, you will get a different image from your screen saver. Feel free to change the delay to something other than 70 seconds, or change the threshold for unread messages to be something other than zero.

[robg adds: I haven't tested this one, but it seems simple enough.]
    •    
  • Currently 2.40 / 5
  You rated: 1 / 5 (5 votes cast)
 
[10,845 views]  

A script to create a 'new Mail messages' screen saver | 2 comments | Create New Account
Click here to return to the 'A script to create a 'new Mail messages' screen saver' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to create a 'new Mail messages' screen saver
Authored by: ob1cannoli on Sep 19, '06 01:48:57PM

if you're using Gmail, you can also use Quartz Composer and the RSS Screen Saver generator to make a nice RSS email one. just a thought



[ Reply to This | # ]
A script to create a 'new Mail messages' screen saver
Authored by: milo on Sep 20, '06 10:16:23AM