Hi,
I am trying to write a .sleep script to employ with the handy SleepWatcher utility to unmount my USB disks and network disks when I send my MacBook to sleep.
My current script is
#!/bin/sh
osascript -l AppleScript -e 'tell Application "Finder" to eject every disk whose ejectable is true or not local volume is true'
The problem with this is that it does not verify that the unmount has been successful, so sometimes the computer shuts down with the drives still mounted.
Does anyone have an idea how I can change the script to:
Wait until the mount has been successful before finishing (and allowing SleepWatcher to shut the system down)
If this does not occur within n seconds display an error message.
Thanks in advice,
Dan (the applescript newbie!)
I am trying to write a .sleep script to employ with the handy SleepWatcher utility to unmount my USB disks and network disks when I send my MacBook to sleep.
My current script is
#!/bin/sh
osascript -l AppleScript -e 'tell Application "Finder" to eject every disk whose ejectable is true or not local volume is true'
The problem with this is that it does not verify that the unmount has been successful, so sometimes the computer shuts down with the drives still mounted.
Does anyone have an idea how I can change the script to:
Wait until the mount has been successful before finishing (and allowing SleepWatcher to shut the system down)
If this does not occur within n seconds display an error message.
Thanks in advice,
Dan (the applescript newbie!)