Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Invalid Key Form -10002



I'm trying to add AppleScript support to a document-based app that uses Core Data. I've got something like the following for a script

tell app "MyApp"
set currentDocument to document "test"
tell currentDocument
set thisThingA to make new thingA
set propertyA of thisThingA to "sometext"
set thisThingB to get thingB 1
set propertyB of thisThingB to "othertext"
end tell


on error errMsg number errNum
display alert "AppleScript Error" message errMsg & " (" & errNum & ")" buttons {"OK"} default button "OK"
end try
end tell


Everything up until the last line (set property B of thisThingB...) works fine. At that line, I get an "Invalid Key Form -10002" error. Both thingA and thingB are Core Data entities, and propertyA and propertyB are text attributes of those entities. I've double checked my dictionary (.sdef) to make sure that I've got proper Cocoa Names for propertyB (and all other properties of thingB), and I can't see any problems. I do get the same error no matter which property I try to set.

I have overridden NSSet/GetScriptCommand but only for debugging purposes. They do nothing other than log some stuff then call and return super's implementation. When propertyA of thisThingA is set, NSSetCommand gets called like I would expect. Not so for the line that produces an error. As far as I can tell, no method in my code gets called before that error is put up.

I don't quite understand what "Invalid Key Form" means, so I just don't know where to look. The error in the log is something like "Error converting Apple event to script command."

Can anyone who has seen this error before give me some hints on where to look for problems?

Thanks!
Andrew
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-implementors/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.