Oh, incidentally, does someone with intimate knowledge of the inner workings
of AppleScript (*cough* Chris Nebel *cough*) know why this Objective-C code
works, but the equivalent call method calls from AppleScript *don't* work?
- (NSDictionary *)setRecord:(NSDictionary *)theRecord label:(NSString *)
theLabel toValue:(id *) theValue;
{
NSMutableDictionary mutableRecord = [NSMutableDictionary
dictionaryFromDictionary:theRecord];
[mutableRecord setObject:theValue forKey:theKey];
return [autorelease mutableRecord];
}
Using call method to call this method works:
(given myRecord, myLabel, myValue)
set myRecord to (call method "setRecord:label:toValue" of myClassWithMethod
with parameters {myRecord,myLabel,myValue})
--result: entry in myRecord with label myLabel is now equal to myValue
But using call method to duplicate the logic within the method doesn't work:
(again, given myRecord, myLabel, myValue)
set mutableRecord to (call method "dictionaryFromDictionary:" of class
"NSMutableDictionary" with parameter myRecord
call method "setObject:forKey:" of mutableRecord with parameters
{myValue,myLabel}
set myRecord to mutableRecord
--result: myRecord is unchanged
Anybody know what gives?
Topher
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden
This email sent to email@hidden