On Apr 9, 2014, at 9:13 AM, 2551 wrote: Way back when Matt Neuburg wrote AppleScript: The Definitive Guide, he stated that: “There is no built-in way to obtain a list of the names of the items of a record…I have seen many elaborate
The "System Events" dictionary contains the "Property List Suite" which looks tantalizing close to doing this. I experimented with this for awhile ...
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 -- tell application "System Events" -- some property list item of infoRecord -- Error: Can't get some property list item of ... -- some property list item of plistInfo -- returns a text character end tell end run
Either I'm not reading the dictionary correctly or it's broken. I found no way to use the Property List Suite to get the name of a record item. Still, the dictionary looks like I ought to be able to do this. If I 'log' the infoRecord , I can see the names and values that I want in the Console window. ^%$#@!
|