Scriptable container objects in cocoa without defined element order
Scriptable container objects in cocoa without defined element order
- Subject: Scriptable container objects in cocoa without defined element order
- From: "Neal A. Crocker" <email@hidden>
- Date: Tue, 15 Jan 2002 23:30:49 -0800
Is is just me, or does Cocoa provide NO support for exposingcontainer
objects and their elements to applescript where the elements have no
defined order. Everything I'm seeing in the cocoa documentation
about scripting support, such as the description of
NSScriptKeyValueCoding, seems to assume that if an object contains
many objects of another class, those elements will have defined
indices, and, therefore, a defined order. Am I wrong? Can anybody
show me how to expose a container object to applescript in a cocoa
applikcation whose elements don't have a defined order? What i'm
specifically interested in doing is creating a server application
that manages NSDictionary objects. I want to expose each
NSDictionary object to applescript as a container object with
elements called "entries". Each entry has a "key" and a "value".
Ideally, I'd like each "entry" to be specifiable by ID and I don't
want to impose some arbitrary order on the entries in an NSDictionary
so that they can specified by index.
Thanks,
Neal.