Re: Ejecting An Image Disk
Re: Ejecting An Image Disk
- Subject: Re: Ejecting An Image Disk
- From: Axel Luttgens <email@hidden>
- Date: Fri, 31 Oct 2008 14:50:29 +0100
Le 28 oct. 08 à 21:51, Luther Fuller a écrit :
I have found a fix for the problem, but not yet an explanation.
Modify the ejectImageDisk handler like this ...
on ejectImageDisk(mountPoint)
tell application "Finder"
do shell script "hdiutil detach " & mountPoint & " -force"
end tell
end ejectImageDisk ----------------------------
I now get instant ejection. Every time. But why do I need to tell
Finder?
I've never had to enclose 'do shell script ...' in any kind of tell
block.
Something strange is happening here that needs explaining.
So, as a variation on my previous email, let's try this one:
on run
set start to current date
tell application "Finder" to do shell script "hdiutil detach /dev/
disk1"
display dialog (current date) - start
end run
on open
set start to current date
tell application "Finder" to do shell script "hdiutil detach /dev/
disk1"
display dialog (current date) - start
end open
Indeed, the delays are greatly reduced as well; even if, in this case,
the Finder seems to somewhat burp after the script's execution.
Somebody more knowledgeable than I am should be able to fully explain
that (beneficial) interaction with the tell block, but I suspect the
rationale to be in the same vein as with the "umount" approach. This
makes me remind of the history of the "mount volume" command from the
Standard Additions; from times to times, it needed to be targeted to
the Finder for being able to do do something useful...
HTH,
Axel _______________________________________________
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