I’m one of those Mac users that forgets to eject any cds I may have in the CDRom drive.
I created this script in OS 9 to ask if I had, and if I had not the script would do it for me.
display dialog "Did you remember to eject your CD?" with icon ¬
stop buttons {"No", "Yes"} default button "Yes"
set button_choice to button returned of result
if button_choice is "No" then
beep 1
tell application "Finder"
«event fndrptwy» (every disk whose ejectable is true)
end tell
end if
And it works just fine. But when I tryed to get it to run in OS X I get the following error:
Can anyone tell me what this error means and help me to fix the issue, please?
Model: Power Mac G3
AppleScript: 1.8.1
Browser: Firefox 1.0.8
Operating System: Mac OS X (10.0.x)
display dialog “Did you remember to eject your CD?” with icon ¬
stop buttons {“No”, “Yes”} default button “Yes”
set button_choice to button returned of result
if button_choice is “No” then
beep 1
do shell script “drutil eject”
end if
I think «event fndrptwy» was the event code for the Finder’s former ‘put away’ command, which was similar to ‘eject’ and hasn’t been carried over to OS X.