• 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: names of a record's items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: names of a record's items


  • Subject: Re: names of a record's items
  • From: Luther Fuller <email@hidden>
  • Date: Wed, 09 Apr 2014 12:36:31 -0500

On Apr 9, 2014, at 11:56 AM, Axel Luttgens wrote:

Indeed... ;-)

set rec to {a:999, b:"text", c:{1, 2}}
tell application "System Events"
name of property list items of (make new property list item with properties {value:rec})
end tell
--> {"a", "b", "c"}

Thanks! A little more experimenting with this got me here ...

on run
set plistInfo to (do shell script "diskutil info -plist " & "OS_X")
-- plistInfo is class text in xml format
tell application "System Events"
set infoRecord to value of (make property list item with properties {text:plistInfo})
-- infoRecord is class record
end tell
--
my inspectRecord(25, infoRecord)
display dialog (item 1 of the result) & " = " & (item 2 of the result)
end run

on inspectRecord(i, aRecord)
tell application "System Events"
set propList to (make new property list item with properties {value:aRecord})
set nameList to (name of property list items of propList)
try
set itemName to item i of nameList
on error
return {i as text, "  item does not exist"}
end try
set itemValue to value of property list item itemName of propList
end tell
return {itemName, itemValue}
end inspectRecord ---------------

Does this do anything useful ?





 _______________________________________________
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: 
 >Re: names of a record's items (From: Luther Fuller <email@hidden>)
 >Re: names of a record's items (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: names of a record's items
  • Next by Date: Re: names of a record's items
  • Previous by thread: Re: names of a record's items
  • Next by thread: Re: names of a record's items
  • Index(es):
    • Date
    • Thread