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

Re: Getting record items of a sublist


  • Subject: Re: Getting record items of a sublist
  • From: wayne melrose <email@hidden>
  • Date: Sun, 30 Oct 2011 10:57:28 +0100


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.
 _______________________________________________
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

  • Follow-Ups:
    • Re: Getting record items of a sublist
      • From: Ronald Hofmann <email@hidden>
References: 
 >Fwd: Getting record items of a sublist (From: Ronald Hofmann <email@hidden>)
 >Re: Getting record items of a sublist (From: Alex Zavatone <email@hidden>)
 >Re: Getting record items of a sublist (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: Getting record items of a sublist
  • Next by Date: Re: Getting record items of a sublist
  • Previous by thread: Re: Getting record items of a sublist
  • Next by thread: Re: Getting record items of a sublist
  • Index(es):
    • Date
    • Thread