Hello all,
I was wondering if someone has come up with a way of checking to see if a blank DVD is loaded in the DVD drive. I’ve written a few lines that can check if a DVD is in the drive in general:
set dvdlocation to "disk1"
try
set disccheck to do shell script "diskutil list | grep " & dvdlocation
on error
my WriteLog("There is no DVD in the computer, or it is not at " & dvdlocation & ". This may be because there is another device, such as an external drive, hooked up. You will need to change the definition of the \"dvdlocation\" variable in the Applescript." & return)
But this is sub-optimal, because a) the DVD may not always be at disk1 (I think if an external drive is connected before the DVD is loaded, it might become disk2, for instance), and b) it doesn’t check if the disc is blank. Knowing that blank DVDs show up in the Finder as “Untitled DVD”, I had hoped to maybe grep the mount list for “Untitled DVD” as the name of an existing volume, but apparently the “Untitled DVD” name that shows up in the Finder is only a pseudo-name, as it doesn’t show up in diskutil:
/dev/disk0
#: type name size identifier
0: Apple_partition_scheme *74.5 GB disk0
1: Apple_partition_map 31.5 KB disk0s1
2: Apple_HFS John 74.4 GB disk0s3
/dev/disk1
#: type name size identifier
0: *0.0 B disk1
and the disc doesn’t show up in /Volumes at all until after it’s formatted, so no help there either.
Any ideas?