from that dictionary, i can iterate over the keys and use
NSScriptClassDescription* cd = -[NSCreateCommand
for (NSString* aPropertyKey in props)
NSString* pType = [cd typeForKey: aPropertyKey];
and then i could check the type of the object value in the (props)
dictionary to make sure it is the same type as specified in my sdef.
quoting from the documentation for typeForKey:
The name of the declared type of the attribute or relationship
identified by key; for example, "NSString". Searches in the receiver
first, then in any superclass. Returns nil if no match is found.
however, i'm not finding this to be the case. intead, i'm getting the
intrinsic name for common properties, eg, "text" (not NSString) and
"integer" (not NSNumber).
i've tried parsing the sdef xml, but the intrinsics are apparently
not part of the sdef xml. for this purpose, i've been creating an xml
NSXMLDocument* sdefDoc = [[NSXMLDocument alloc]
initWithContentsOfURL: sdefURL options: 0 error: &error];
(where sdefURL points to the sdef file in my app's bundle)
so... how can i find out the cocoa class for the built-in types? and
does anyone know if this is a bug in NSScriptClassDescription or a
bug in the documentation?
ps. note that i know my code for exploring the xml doc works as i can
pass it the names of some value-types declared explicity in my sdef
file, and i can find them fine.
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription: