Maria’s Guides

Support and additional material for readers of books, articles, and digital media by Maria Langer.


Random Book Cover #1Random Book Cover #2Random Book Cover #3Random Book Cover #4Random Book Cover #5Random Book Cover #6Random Book Cover #7Random Book Cover #8Random Book Cover #9

Powering Off with a Light Timer and Automator

Posted on December 20th, 2007 at 5:00 am · 2 Comments
Filed in: RSS Mac OS Books   

A bit geeky but effective.

My little home-based office has a lot of computer equipment in it. And since there’s always so much on my mind, I often forget to turn off certain peripherals when I’m finished using them or simply done for the day. These include two laser printers and the external hard disk I use with Time Machine.

Although I could leave them on all the time, it really isn’t a good idea. My main printer, which is about 5 years old now, seems to develop toner cartridge problems when it’s left on all the time. The darn cartridges cost $95 each. And it simply can’t be a good idea to leave a hard disk spinning all the time.

And then there’s the power. It’s not cost as much as the idea of it. Leaving devices turned on when you’re not using them is wasteful, plain and simple.

So I’ve come up with a solution: a light timer.

By light timer, I’m referring to a device you might use to turn lights on and off while you’re away on vacation to make it look like you’re home. I bought one with a three-prong outlet on it. I set it to turn on every morning at 5 AM, which is when my computer turns on for the day, and turn off every evening at 8 PM, which is when I’m usually done working for the day. I plugged a surge suppressor power strip into it and plugged the two printers and hard disk into it. Then I turned them all on.

Now those of you who know Mac OS know what happens when you turn off power to a connected and mounted hard disk. Your Mac displays a message telling you that the device was improperly disconnected and that file errors may result. So it’s not a good idea to simply turn off an external hard disk while the computer it’s connected to is still on and the disk is still mounted.

The solution to that is to make sure the disk is unmounted before it is powered down. But if I can’t remember to flip a few power switches at day’s end, what makes you think I can remember to unmount a hard disk? Obviously, I can’t.

Enter Automator. I wrote a very simple Automator Action that unmounts the disk. As shown here, it has only two steps:

  1. Automator ActionGet Specified Finder Items identifies the disk.
  2. Eject Disk unmounts the disk.

Then I used the iCal alarm trick to run the action every day at 6 PM.

So here’s how it all works. My computer is set to automatically start at 5 AM each morning. At about the same time, the light timer turns on the 3 peripherals, including an external hard disk connected to the computer. I come to work. I work. I wander out sometime late in the afternoon. At 6 PM, the hard disk unmounts using the Automator action triggered by iCal. I might wander back in, but I don’t need that external hard disk so I don’t even notice it’s gone. Or I might not wander in at all. At 8 PM the peripherals turn off, thanks to the light timer. Around the same time, computer shuts down automatically. Or maybe I shut down the computer earlier or later, depending on what I’m doing with it.

The point is, all this electronic stuff is turned off at night so I’m not wasting electricity on it.

Would it be easier to do it all manually? I don’t think so.

And one of these days I might get brave enough to explain how I set up iCal to remind me to drink a glass of water every hour all day every day. (And no, I don’t need it to remind me to head to the loo.)

Chapter References

Product ImageYou can learn more about automating tasks with Automator and AppleScript in Mac OS X 10.5 Leopard: Visual QuickStart Guide. I introduce them both in Chapter 25.

→ 2 Comments • Read 1198 Times
Add to Del.icio.usAdd to Del.icio.us • Technorati ThisTechnorati This • Digg ThisDigg This • Stumble ItStumble it! • Twit ThisTwit This