Re: UUID
Re: UUID
- Subject: Re: UUID
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 31 Jan 2008 15:29:59 -0500
You can also get the UUID in one shell command with no subsequent modification of the output needed:
do shell script ¬
"diskutil info /Volumes/" & ¬
quoted form of name of adisk & ¬
" | awk '/UUID:/ {print $NF}' "
Altneratively, you could use the -plist option to diskutil info to get the result in XML property list form, and then use XMLlib.osax to parse out what you need (it appears the standard additions plist stuff won't accept input from a string, only from a plist file).
On Jan 31, 2008 2:47 PM, Luther Fuller <
email@hidden> wrote:
repeat with adisk in diskList
"diskutil info /Volumes/" & (name of adisk) & "/"
FWIW, I don't believe that ( "/Volumes/" + (name of disk) ) is guaranteed to work in all cases, since if you have two disks with the same volume name, the (name of) will return the same value for both of them, while the mount point under /Volumes will necessarily be different. This is a rare edge case that you might not want to worry about.
Given the (not necessarily unique) volume name, one way to get a unique disk identifier (the diskXsY version) is this:
set diskName to (do shell script "diskutil list | awk '($3==\"" & (name of adisk) & "\") {print $NF}'")
but that's susceptible to a more likely problem, in that it won't work if the volume name has a space in it...
_______________________________________________
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
- Follow-Ups:
- Re: UUID
- From: Skeeve <email@hidden>
- Re: UUID
- From: Luther Fuller <email@hidden>
References: | |
| >UUID (From: Luther Fuller <email@hidden>) |
| >Re: UUID (From: Skeeve <email@hidden>) |
| >Re: UUID (From: Luther Fuller <email@hidden>) |