Re: UUID
Re: UUID
- Subject: Re: UUID
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 31 Jan 2008 15:49:23 -0500
On Jan 31, 2008 2:04 PM, Richard Fairbanks <
email@hidden> wrote:
After guessing that 'diskutil info ...' is a "do script"
command, the following does NOT return the UUID, nor does any
convolution thereof:
return do shell script "diskutil info /mount/point | grep UUID"
It would work if you replaced "/mount/point" with the actual POSIX path of the root of the disk. Usually this is "/Volumes/volumename", e.g. "/Volumes/Time Machine Backups". In this case "/mount/point" is to be read like the phrase "your name here": it's a description of what you need to put there, rather than the exact thing you type.
I mucked around for a while and found that I can get the disk
identifier, not the UUID, with:
return do shell script "diskutil list"
--> disk0s2
That seems unlikely to me. "diskutil list" OMM returns a lot more than just the disk identifier(s).
and then tried various versions of:
return do shell script "diskutil info disk0s2"
That is the command under discussion, yes.
The best I can get is 20 lines of info. which do include the
UUID.
Right. This is not unusual when using "do shell script". The result is a bunch of text that you then have to extract the desired info from. You can add shell commands (awk, grep, sed) to the string to build a pipeline that will return only what you want, or you can use text item delimiters (or, sure, BBEdit) or whatever to parse it out in AppleScript. I prefer the former, but it comes down to what you know. In the particular case of diskutil, as I mentioned, you also have the option of getting the reply back in XML form which XMLlib.osax will happily turn into records for you.
(I appreciate that we are all very busy, but for that same
reason there are some of us who would be grateful if direct
questions could be given direct answers, not just clues, and if
you do figure out the answer, please do not continue to keep it
a secret!
We are not trying to be oracular, honest. We are just sending as much info as we have time to type up. If the OP has enough background, they'll be able to solve their problem. If not, more info will no doubt follow later as time permits either the same responder or others to add to the thread. And there's always Google, although sometimes it's hard to know what to Google for...
--
Mark J. Reed <
email@hidden>
_______________________________________________
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: | |
| >Re: UUID (From: Richard Fairbanks <email@hidden>) |