Re: UUID
Re: UUID
- Subject: Re: UUID
- From: Skeeve <email@hidden>
- Date: Thu, 31 Jan 2008 21:04:20 +0100
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
return uuid_list
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
References: | |
| >UUID (From: Luther Fuller <email@hidden>) |