• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Ejecting An Image Disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Ejecting An Image Disk
      • From: Axel Luttgens <email@hidden>
    • Adding File Permissions Change
      • From: Tom Thompson <email@hidden>
References: 
 >Ejecting An Image Disk (From: Luther Fuller <email@hidden>)
 >Re: Ejecting An Image Disk (From: Luther Fuller <email@hidden>)
 >Re: Ejecting An Image Disk (From: Luther Fuller <email@hidden>)
 >Re: Ejecting An Image Disk (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: Ejecting An Image Disk
  • Next by Date: Adding File Permissions Change
  • Previous by thread: Re: Ejecting An Image Disk
  • Next by thread: Adding File Permissions Change
  • Index(es):
    • Date
    • Thread