Detecting DVD burner via applescript...?


i’m writing up a little applescript application to, well, help out the computer illiterate masses in their attempts to do video work on my department’s machines at school :slight_smile:

one of the most common problems people have is that we only have a handful of machines with DVD/CD burners, and people neglect to check to see if the machine has a burner when they start working…

is there a way to detect if a machine has a superdrive via some boolean in applescript…?

thanks for your help!

I can’t say for sure if this will work or not but you could test it on a few machines to see. It’s a long shot.

set selectors_ to {2, 4, 6, 7}
set att to system attribute "cdDVDROM"
if att is not in selectors_ then
	display dialog "No burner detected"
	display dialog "Burner present"
end if

– Rob

thanks for the quick reply!

pardon my newbie-ness(this is my first applescript app),
but… should i be telling this to the finder…?

i got your code to compile, but it reports no burner present on all machines…

No, it isn’t anything that the Finder needs to be involved in. I had my doubts but it was worth a shot. I don’t have any more ideas on how to test for a empty drive. It might be possible to put something together if there was media in it. :slight_smile:

– Rob

Rob & Oranje, you might be able to use AppleScript & the command line to get this info by using the “ioreg” command. Here’s what I have so far…

If I remember correctly DVD-Rom’s are read only and DVD-RAM’s are the burners. Mine is returning DVD-ROM which is correct – I do not have a SuperDrive. Please note that the above script is a little klunky and it still needs some work.

Oranje, let me know if it returns DVD-RAM on your machines that have a SuperDrive installed. tia

BTW: I’m not sure the SuperDrive is manufactured by HITACHI.

This might work too…

Maybe Camelot, or Jon, can help with the command line stuff to get a better output.

I posted this the other day but the server appears to have eaten it.


Aha, nice work Jonn8, I now see that cut -d ‘"’ is a way to delimit items – a delimiter. Unix, ya gotta luv it, I’m still learning ;¬)

Your script correctly returns the “Optical Drive” I have installed in my machine as a DVD-ROM. I hope I was correct in assuming that DVD-RAM’s are burners and that DVD-ROM’s are players. Do you have any ideas of how we can get 'External Drive Info" i.e., I have a Firewire Sony Spressa CDRW. ioreg does see my Plantronics HeadSet, but I haven’t grep’d out the Sony Spressa CDRW yet, as it’s normally turned off until needed.

Between this, and your posts to Get Machine Info, @ Code Exchange , it looks like we have a fairly comprehensive System Reporter. Go Jon…

OT: Did you read the Disk Copy post at Mac OS X Hints yet, it’s a good one…

it appears to work… i’ll be testing it out on the other machines tomorrow…

thanks to all for your help, and especially to jonn8 for getting to the bottom of this.