Running AppleScript When Inserting a Blank CD

applescriptcd-burning

I want to automatically burn a cross-platform data CD with the same contents each time a blank disc is inserted, and eject it when done. To that end I created a very simple AppleScript that does just that:

do shell script "/bin/bash -c 'hdiutil burn ~/Desktop/catalog.iso'"

It works fine from the AppleScript editor. If I click "Run" with a blank CD inside, it burns the CD with the data from the .iso and ejects it upon completion.

However, if I select "Run ~/Desktop/burn.scpt" as the default action when inserting a blank CD, nothing happens. I actually have to open the AppleScript editor and select "Run". How can I make it actually run the script?

blank cd dialog

Best Answer

Open burn.scpt in the AppleScript Editor and save it as an Application. Then select burn.app as the desired action on CD popup.