
I often have many external volumes connected to my laptop at any given time (network drives, iPods, external HD, etc.). It can be annoying to manually disconnect each one of them before I unplug the USB hub. Instead I use a quick AppleScript to do the job of disconnecting all of my external volumes. I bind the script to a QuickSilver trigger and fire that up before I’m about to disconnect the hub. It saves me a bit of sanity.
Download unmount_all_drives.applescript
tell application "Finder"
set allVolumes to the name of every disk
repeat with i from 1 to the count of allVolumes
if item i of allVolumes is not the name of the startup disk then
-- Uncomment the 2 lines below if you don't want Network drives unmounted.
-- if item i of allVolumes is not "Network" then
eject (item i of allVolumes)
-- end if
end if
end repeat
end tell