i can tell the finder to eject/unmount a server volume, or firewire volume…but why doesn’t it work w/ a secondary system partition. my drive is partitioned into two volumes…both volumes have 10.3.7 installed…this should be easy, right?
here’s what i’m working with (Backup is the name of the volume i’m trying to unmount)
tell application “Finder” to eject “Backup”
I think you’ll find that you can’t eject a partition even if you attempt to do it directly from the Finder. The meaning of the verb “eject” is tied to removable drives. In general, mounted partitions are not intended to be removable.
I suggest either trying to find another scriptable application that will unmount the partition, or else try to come up with a way to do it with a shell command.
Unfortunately, it doesn’t look like Apple’s Disk Utility is scriptable…
I didn’t realize the Finder let you get away with dragging partitions to the eject icon. Very interesting! I’d say it’s probably a bug, but who knows.
Maybe somebody else will be able to come up with something less drastic than scripting a drag to the icon. Thats seems kind of flimsy. I bet you can do this somehow with a UNIX command line tool.
So I dug around and with the help of some internet clues I discovered that hdiutil can be used to unmount regular ol’ volumes. I thought it was only for disk images.
An example to unmount a volume (partition or not) named “MyPartitionName”:
UnmountPartition("/Volumes/MyPartitionName")
on UnmountPartition(partitionPath)
do shell script "hdiutil unmount " & partitionPath
end