ejecting a mounted disk image under 9 and X
ejecting a mounted disk image under 9 and X
- Subject: ejecting a mounted disk image under 9 and X
- From: Craig Knelsen <email@hidden>
- Date: Tue, 30 Nov 2004 10:46:05 -0600
I want to eject a disk image (mounted from an .smi) that works for both OS 9 and X. The following script works under OS X but does nothing under OS 9 (well, the image icon on the desktop seems to blink once):
property imageVolume : "Internet Exploder 5.1.7:"
on run
ejectVolume(imageVolume)
end run
on ejectVolume(anImageVolume)
tell application "Finder"
try
eject (anImageVolume as alias)
on error errorMsg number errNum
--if errNum is not -43 then (* -43 is file not found *)
tell me to display dialog "Unable to unmount image volume " & anImageVolume & ¬
return & errorMsg & " (" & errNum & ")" buttons {"OK"} ¬
with icon stop default button 1
--end if
end try
end tell
end ejectVolume
If I replace "eject" with "put away" or "delete", this works under OS 9 but NOT under OS X. "put away" no longer seems to be supported under OS X Finder. If I try "delete", the Finder pops up a dialog stating it is going to move the item to the trash but this fails and actually crashes the Finder (it seems to restart the Finder anyways). I would prefer not to have to check the OS version and use "eject" for OS X and "put way" for OS 9. Is there a way I can do this without resorting to an OS version check? _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden