• 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: Record/List Coercion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Record/List Coercion


  • Subject: Re: Record/List Coercion
  • From: email@hidden
  • Date: Wed, 30 Apr 2008 11:30:33 +0200

At 5:41 PM -0700 4/29/08, Tom Chen wrote:
1) Is it possible to loop through a record systematically?

PLists are for that. Use for instance XMLLib osax to write:

set thePlist to PlistNew theRecord

Then "PlistGetKeys thePlist" will return the list of the keys and you can loop through them.

See for one example of use:
http://www.satimage.fr/software/en/smile/xml/plist_tutorial.html

2) Is there a way to preserve ordering of a record coerced to a list
(currently, when I coerce a record to a list, the list has a different
ordering than the record)

Unfortunatel there is no such things as the order of a record. I don't know of an associative array structure (like AppleScript's record class) which would respect some order.


Emmanuel
_______________________________________________
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: 
 >Record/List Coercion (From: "Tom Chen" <email@hidden>)

  • Prev by Date: Re: Record/List Coercion
  • Next by Date: [OT] test please ignore
  • Previous by thread: Re: Record/List Coercion
  • Next by thread: Re: Record/List Coercion
  • Index(es):
    • Date
    • Thread