Auto-eject external drives when Macbook goes to sleep
Edit August 28, 2010: SleepWatcher has been modified and differs compared to the information that is found in the link below. The information does, however, still work, as does the modified script that I provide below.
I have a Macbook, and have always been annoyed that I manually have to eject my external disk every time I put the computer to sleep. In Windows, I have never had any such problems.
Luckily, I found a solution to this problem. The link below provides a link to a nice piece of software called SleepWatcher, and also provides you with a nice collection of wakeup and sleep scripts:
Following the information there will make sure that all of your disks are automatically ejected when your computer goes to sleep.
However…the original script will also eject USB drives, mounted .dmg drives etc…which is not what I want. I only want to eject the external drive. I therefore edited the .sleep script to the following:
#!/bin/sh osascript -e 'tell application "Finder" to eject (disks where name = "type in the name of your disk here")'
Voilá – your external disk will now go to sleep when your computer does…and no more annoying warning messages.