On Oct 30, 2011, at 10:49 AM, Axel Luttgens wrote: For example:
set theNameList to {¬ {myname:"Titzi", height:170, weight:55}, ¬ {myname:"Stephen", height:184.5, weight:75}, ¬ {myname:"Elke", height:174.5, weight:50}, ¬ {myname:"Silke", height:175, weight:60} ¬ }
tell application "System Events" to set theChooseList to value of first property list item of property list items of (make new property list item with properties {value:theNameList}) whose name is "myname" --> {"Titzi", "Stephen", "Elke", "Silke"}
Not sure about the efficiency of the above, but there's no loop... ;-)
Axel
I think this perfectly answers the original question though.. How to get the 'myname' value from a list of records.. nice! This has taught me about using System Events in a way I didnt know existed..
Admittedly, if I were doing something like this, I'd probably already be within my own ASObjC application, in which case I'd use Shane's example, but this is very cool to know for Vanilla AS solutions. |