Alright, that said, here’s a nifty little utility that gives you one last chance to do something cool and geeky before shutting down your Mac. It’s called PowerBlock. It’s free.
Power Off, Power On
My MacBook Air goes with me pretty much wherever I go, thanks to the absence of weight and yet the same capability as a quad-core iMac with a ginormous screen.
Every now and then, usually when I’m not paying attention, I’ll accidentally press the MacBook Air’s power button (which is on the keyboard).
The next thing I know my MacBook’s screen is blank and everything I was working on needs to be started up again.
Enter PowerBlock, a handy utility which gives you the option to run an AppleScript when the power button or key is pressed; by accident, or intentionally.
Press the power button or key and you can shutdown immediately, or restart, or sleep, or even eject a DVD (on older MacBook Pro models).
All PowerBlock does is run an AppleScript to do what you want.
Setting up and using PowerBlock won’t be intimidating, either. Well, except for the AppleScript.
Settings include Start PowerBlock automatically at login, Automatically check for updates, and, of course, the all powerful Run AppleScript with power button is pressed.
Click the Edit AppleScript button to create or edit whatever AppleScript you may want to run when the power button or key is pressed.
As to AppleScript itself, it’s already on your Mac and easily accessible from the Utilities folder. If you need more detail, here’s Apple’s official Introduction to AppleScript, MacTut’s Ultimate Beginner’s Guide to AppleScript, and Brati’s Lover’s AppleScript Library.