Re: Ejecting An Image Disk
Re: Ejecting An Image Disk
- Subject: Re: Ejecting An Image Disk
- From: Luther Fuller <email@hidden>
- Date: Thu, 30 Oct 2008 09:48:37 -0500
More info on Axel's question ...
On Oct 29, 2008, at 6:35 PM, Axel Luttgens wrote:
I mean, for example, why not just eject the mounted disk(s) either
manually or with the help of an eject command targeted to the Finder?
The Finder's 'eject' command looks like this ...
tell application "Finder" to eject disk <disk_name>
It requires the name of a disk and that's a problem when trying to
eject an image disk. You can have two disk image files, for example
"test_1.sparseimage" and "test_2.sparseimage", both of whose disks are
named "test". If you ask the Finder to
tell application "Finder" to eject disk "test"
One of the disks named "test" will be ejected and the Finder isn't
picky about which one. But what I need is to eject the disk mounted
from a particular disk image file. For example, if I need to eject the
disk mounted from the file "test_1.sparseimage"., the only way to do
this is to use the getMountPoint handler from an earlier posting, then
use
do shell script "hdiutil detach " & mountPoint & " -force"
to eject the specific disk associated with this specific disk image
file. The Finder's eject command does not understand a mountPoint.
(Confirmed by some experimenting over the last hour.)
Conclusion: Image disks must be ejected with 'hdiutil detach ', not
via the Finder's 'eject' command.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden