[QUOTE=kbradnam]
To do this I prepend the following to the start of my daily bakck up script (assumes your backup disk is called 'local backup'):
----------------------------------------------------
property diskname : "local backup"
tell application "Finder"
if not (exists the disk diskname) then
do shell script "diskutil mount `disktool -l | grep 'local backup' | sed 's/.*\\(disk[0-9s]*\\).*/\\1/'`"
delay 1
end if
end tell
delay 2
----------------------------------------------------
Then I add the following at the end of the script.
----------------------------------------------------
tell application "Finder"
if (exists the disk "local backup") then
eject "local backup"
delay 2
end if
delay 2
----------------------------------------------------
[/QUOTE=kbradnam]
I had a couple of problems with these script additions. In the first place, I think there is a missing "end tell" in the second one, no?
More confusingly however, the first one would not compile for me, complaining about beginning with "property": 'Expected "end" but found "property".' If I take out the first line (property diskname : "local backup") and just replace both "diskname" and "local backup" with the name of the actual disk I want to mount/unmount, it seems to work fine. What am I missing here?
|