Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UUID



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)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/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:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.