Slow Disk Eject Problem...


on EjectDisk(DiskName)
		tell application "Finder"
			eject DiskName
		end tell
	end try
end EjectDisk

This script almost immediately ejects CD/DVD when invoked from Script Editor. However when I try to launch it from Folder Actions or from Preferences CDs & DVDs pane it takes 10-20 seconds to eject a disk.

What could be the reason for it?
Is there any workaround?

This is the script I use. Gve it a try…

tell application "Finder"
	if (exists disk "DiskName") then
		eject disk "DiskName"
	end if
end tell


Browser: Safari 530.19
Operating System: Mac OS X (10.5)

Thanks, Tom!
Sometimes your code works immediately, sometimes same as mine…

What can cause such behaviour?