Re: Considerable simplification should be possible
Re: Considerable simplification should be possible
- Subject: Re: Considerable simplification should be possible
- From: Nigel Garvey <email@hidden>
- Date: Mon, 28 Apr 2014 14:26:43 +0100
I wrote on Mon, 28 Apr 2014 09:55:39 +0100, I wrote:
>Or the same can be achieved with:
>
> set theVolumeNamesList to paragraphs of (do shell script "diskutil
list |
>sed -En '/[^[:alpha:]]+Apple_HFS / {s///;s/[[:blank:]]{2}.+$//p;}'")
Yvan's pointed out to me off-list that the disk IDs are needed too.
That's fairly easy to arrange:
set theVolumeNamesandIDsList to paragraphs of (do shell script "diskutil list | sed -En '/[^[:alpha:]]+Apple_HFS +/ {s///;s/[[:blank:]]+[0-9.]+[[:blank:]]+[A-Z]+[[:blank:]]+([[:alnum:]]+)$/\\'$'\\n''\\1/p;}'")
set theVolumeNamesList to {}
set theIDsList to {}
repeat with i from 1 to (count theVolumeNamesandIDsList) by 2
set end of theVolumeNamesList to item i of theVolumeNamesandIDsList
set end of theIDsList to item (i + 1) of theVolumeNamesandIDsList
end repeat
However, Shane's posted a solution which Yvan tells me doesn't truncate
long names (an effect of "diskutil list" by itself), so that'll be
better.
NG
_______________________________________________
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