10.5: Eject drives and run iSync before sleep via script
Apr 25, '08 07:30:00AM • Contributed by: avn
Apr 25, '08 07:30:00AM • Contributed by: avn
This is a little AppleScript that I wrote to check and ask if the machine should unmount peripheral disks, and optionally perform an iSync, before sleeping. I was motivated to write this after about the fifteenth time I woke my laptop up after taking it home from work only to be greeted with a warning that I did not properly disconnect my Time Machine Disk.
Additionally, since I use iSync to sync my date book and address book with my Nokia cell phone, I thought it would be a good idea to have it auto-sync before I put the machine to sleep. If you are capable with AppleScript, you can go in and make modifications for your system (e.g. turn off iSync, or the options to unmount). One caveat: if your home disk is not the same as the startup disk (unlikely on a laptop), the script will ask if you would like to unmount that disk before sleeping.
I packed the script as an application bundle (with a 10.5-sized icon) for optional placement directly into the dock -- download it from macosxhints.com [464KB download]. Here's the source: [robg adds: I haven't tested this one, but I did download the disk image and confirm that it's just the script rolled up in an application bundle.]
Additionally, since I use iSync to sync my date book and address book with my Nokia cell phone, I thought it would be a good idea to have it auto-sync before I put the machine to sleep. If you are capable with AppleScript, you can go in and make modifications for your system (e.g. turn off iSync, or the options to unmount). One caveat: if your home disk is not the same as the startup disk (unlikely on a laptop), the script will ask if you would like to unmount that disk before sleeping.
I packed the script as an application bundle (with a 10.5-sized icon) for optional placement directly into the dock -- download it from macosxhints.com [464KB download]. Here's the source: [robg adds: I haven't tested this one, but I did download the disk image and confirm that it's just the script rolled up in an application bundle.]
•
[11,323 views]
