I keep all my music on my portable HD. This way I have all my music available to me on both my work computer as well as my personal computer (both Macs). I got really tired of manually quitting iTunes and then having to go to Finder to unmount the Mobile HD where my iTunes library is stored. Ergo why I created this apple script to do the job for me. So now I can close my computer lid and not have to worry about wether or not I quit iTunes and ejected the drive.
tell application "iTunes" quit end tell tell application "Finder" if (exists the disk "Mobile HD") then eject "Mobile HD" end if end tell