User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.11) Gecko/20071128 SeaMonkey/1.1.7
Luther Fuller wrote:
It is easy to confirm, using Disk Utility, that a disk has a Universal
Unique Identifier (UUID).
Is there any way in AppleScript, perhaps using 'do shell script', to
read the UUID of a disk?
As no one did understand me ;-) here is a handler for you to use:
to uuid(a_disk)
return do shell script "/usr/sbin/diskutil info " & (quoted form of
POSIX path of a_disk) & "/ | /usr/bin/perl -ne 'print if
s/^\\s+UUID:\\s+//'"
end uuid
And here an example of how to get the UUID of every mounted disk. The
result is a list of the disk names followed by a tab, followed by the
UUID if any.
set uuid_list to {}
repeat with a_disk in list disks
copy a_disk & tab & uuid(a_disk) to the end of uuid_list
end repeat