• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Considerable simplification should be possible
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Considerable simplification should be possible
      • From: "koenig.yvan" <email@hidden>
References: 
 >Re: Considerable simplification should be possible (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: Considerable simplification should be possible
  • Next by Date: Re: Considerable simplification should be possible
  • Previous by thread: Re: Considerable simplification should be possible
  • Next by thread: Re: Considerable simplification should be possible
  • Index(es):
    • Date
    • Thread