Re: UUID of a volume
Re: UUID of a volume
- Subject: Re: UUID of a volume
- From: Doug McNutt <email@hidden>
- Date: Sun, 16 Mar 2014 17:25:45 -0600
At 12:34 -0700 3/16/14, Lists wrote:
>I have a working script, but I'm well out of my comfort zone with shell scripting. Is it possible to do this with pure AppleScript?
>
>tell application "System Events"
> set nm to name of every disk
> set myVolumes to items 1 thru -3 of nm
>end tell
>set choice to choose from list myVolumes with prompt "Choose disk."
>if the result is not false then
> set DiskName to choice
> set shellScpt to "diskutil list | grep '" & DiskName & "'"
> set whatItem to (do shell script shellScpt)
> set DI to last word of whatItem
> set shellScpt2 to "diskutil info " & DI & " | grep 'Volume UUID:'"
> set UUIDstring to do shell script shellScpt2
> set volUUID to last word of UUIDstring
>end if
I personally NEVER pass anything to do shell script without protecting arguments with "quoted form of". Those quote marks likely need to be escaped and then the escapes you add need to be escaped themselves.
--
--> From the U S of A, the only socialist country that refuses to admit 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