How can exclude mounted CD's from my searches?

Rob,

Just a couple of points:

  1. Congratulations on the clever use of “Posix path” and “Posix file” to deal with forward slashes in file names!!
  2. “list disks” (as Stefan suggested) is a scripting addition and doesn’t need to be inside a Finder block
  3. 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

Thanks everyone for helping me with this script. It is greatly appreciated.

I am a real newbie to Applescript. I just started learning Applescript about 2 weeks ago. I still have a lot to learn.

Many thanks.

Rob