My problem is that I have an external hard drive connected to my Mac. Since it is only used for backup purposes, it is sleeping most of the time.
However if I now want to save something (e.g. a picture from a website) to my internal hard disk, I have to wait for the external one to wake up before the "save as..." dialogue appears.
I know about the question How to save a file quickly and no need to wait for the external hard drives to "wake up"?, but it sounds like it intends a solution about not letting the hard disks go to sleep whereas I would like to let the external hard drive have its well-deserved rest.
- I do not want to unplug it, because I know that I will forget to reconnect it before the automatic backup
- various other operating systems deal very well with situations like that
Using Sherwood Botsford's answer I put together the following AppleScript which mounts the hard drive, executes for example an rsync and unmounts it again.
do shell script "diskutil mount 'Name of your Volumn'" do shell script "rsync -av --delete ~/ '/Volumes/Name of your Volume/.'" do shell script "diskutil unmountDisk 'Name of your Volume'"