• 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: UUID
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UUID


  • Subject: Re: UUID
  • From: "Mark J. Reed" <email@hidden>
  • Date: Thu, 31 Jan 2008 19:43:54 -0500

OK, Luther, to avoid any issues with duplicate volume names, just replace this:

"diskutil info /Volumes/" & (name of adisk) & "/"

with this:

"diskutil info " & (quoted form of POSIX path of adisk)

(the trailing / isn't needed.)










on run
       tell application "Finder"
               try
                       set diskList to (disks whose local volume is true and ejectable is
true) as alias list
               on error
                       set diskList to {(some disk whose local volume is true and
ejectable is true) as alias}
               end try
               repeat with adisk in diskList
                       "diskutil info /Volumes/" & (name of adisk) & "/"
                       set uuid to do shell script the result
                       --
                       set AppleScript's text item delimiters to {"UUID:"}
                       set uuid to text item 2 of uuid
                       set AppleScript's text item delimiters to {return}
                       set uuid to (text item 1 of uuid)
                       set AppleScript's text item delimiters to {space}
                       set uuid to last text item of uuid
                       --
                       display dialog uuid
               end repeat
       end tell
end run

I am amazed that I still have to use the try-block to work-around
AppleScript's inability to get a one item list.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden



--
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: 
 >UUID (From: Luther Fuller <email@hidden>)
 >Re: UUID (From: Skeeve <email@hidden>)
 >Re: UUID (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: UUID
  • Next by Date: Re: UUID
  • Previous by thread: Re: UUID
  • Next by thread: Re: UUID
  • Index(es):
    • Date
    • Thread