Rob,
Just a couple of points:
- Congratulations on the clever use of “Posix path” and “Posix file” to deal with forward slashes in file names!!
- “list disks” (as Stefan suggested) is a scripting addition and doesn’t need to be inside a Finder block
- the “egrep” command was revised
The revised script (the version that extracts volume names, not paths):
set all_volume_names to list disks -- > includes names of CDs and DVDs as seen on the desktop
set CDDVD_unix_volume_names to {}
set CDDVD_apple_volume_names to {}
repeat with i from 1 to length of all_volume_names
set item i of all_volume_names to POSIX path of item i of all_volume_names
try
do shell script "diskutil info '" & (item i of all_volume_names) & "' | egrep '(Drive Type: +CD-)|(Drive Type: +DVD-)'" -- > executes without an error for CDs and DVDs
set end of CDDVD_unix_volume_names to text 10 thru -1 of (item i of all_volume_names)
set end of CDDVD_apple_volume_names to POSIX file (item i of all_volume_names) as string
end try
end repeat
bmose