Drive geekery for those of us who store stuff externally

Well, at least I have some fun geekery to share.

I'm going to sell my iMac because I never use it. I use my Air exclusively; the iMac had become a big media server. I moved the media off of it. So I now have a crapton of media and other stuff on a 1-TB external drive split into three partitions (Media, Time Machine, and SuperDuper clone, for the curious).

The issue with practical use of this setup is that one point of having an 11-inch paper-thin Mac is being able to snatch it up and take it somewhere, right? Well, you can't do that if it's hooked up to a bunch of external stuff because you have to wake it up, unmount everything, and unplug the wires, then put it back to sleep. This annoys me. When it's on my desk, I want access to my media, my printer, my scanner, and all the junk I have lying around here. But I also want it to be a free laptop.

I've solved the problem.

It required a damn handy app called Scenario that you can score for a mere $4.99 on the Mac App Store, and I'm sure Scenario and I will be cozying up over other issues as well, but for now I paid the $4.99 so I could use this one script the way I wanted:

tell application "iTunes"


end tell


tell application "iPhoto"


end tell


tell application "Finder"

set local_disks to every disk whose local volume is true

repeat with local_disk in local_disks

eject local_disk

end repeat

delay 5

end tell

It's no problem to write an Automator app or Applescript to eject the drives (I also wrote an Automator app to mount the same partitions and START iTunes and iPhoto, for when I'm at my desktop and want that stuff, but it's just a plain app because I don't want it running every time the Air wakes up…what if I'm at a coffee shop?). The problem is getting the Mac to do it when it goes to sleep. Scenario handles that. This Applescript quits iTunes and iPhoto (otherwise the Media partition will not unmount) and then ejects my external drive partitions, and Scenario allows it to run every time the Air sleeps. Therefore, I can unplug my USB hub and walk off with the Air at any time without fear that something is mounted that shouldn't be.

It's actually pretty slick.