Re: NSDictionary simulation
Re: NSDictionary simulation
- Subject: Re: NSDictionary simulation
- From: has <email@hidden>
- Date: Thu, 19 Jan 2006 13:49:14 +0000
email@hidden wrote:
>can a list of property names be obtained from a variable of class record?
>can the property name of a variable of class record be accessed via a variable of class string?
>
>does anyone know how to use class record to store an actual varying dictionary of unknown keys?
AppleScript records are collections of properties, roughly analogous to C structs in use. The underlying implementation is a key-value list, but you don't have access to that from the language.
AppleScript doesn't provide a native dictionary type, so an obvious solution is to roll your own or use an existing one, e.g. <http://applemods.sourceforge.net/mods/Data/Types.php> works well for up to a few thousand items.
There's also various applications and osaxen that can store values under arbitrary keys which may be an option, though you're a bit restricted in the types of values you can store in those due to the limitations in Apple events. Or you could maybe use a scripting language that has such features built-in as standard in place of AS.
HTH
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden