Tuesday, February 08, 2005

The macosxhints Forums - Applescript to detect mounted volume/disk/share type: "It is possible to get some info via AS which maybe sufficient for your needs.

Firstly, please note that 'list disks' does NOT return a list of physical disks - it returns a list of volumes. Obviously, where physical discs contain only a single volume/partition this isn't important, but will this be so in your case?

The following script will produce a property list of one of your volumes. You could use these properties to detect whether a CD was inserted for example (it'll be ejectable and have a CD format) See the Finder dictionary ('disk' class) for more.


set thedisk to item 1 of (list disks)
tell application 'Finder'
properties of disk thedisk
end tell
"

No comments: