| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
It's probably your implementation of objectSpecifier, or else an incomplete dictionary or sdef file. Have you followed the good advice on <http://cocoadev.com/?HowToSupportAppleScript>?
On 21 Sep, 2004, at 6:15 PM, Doug Knowles wrote:
I'm trying to get scripting support working in an application I'm starting, and I'm part way there (after following advice found on this list), but I'm stumped by the partial results I'm seeing. Briefly, my application will enumerate a property I've defined, but not accept a scripted reference to the property.
My subclass of NSDocument exposes a to-one reference to an object of class "Category" via a method named "rootOrganizer"; the terminology defines the property as "root organizer". I have implemented objectSpecifier: on the referenced object per advice I found on this list.
As things stand now, if I write a script to enumerate the properties on my document, my new property does appear in the event log:
set props to properties of document 1
{false, name:"Untitled", missing value, document, root organizer:root organizer of document "Untitled"}
However, if I try to reference the new property, I get errors:
- if I use the method name directly, the script compiles but reports an error:
get rootOrganizer of document 1
"Prospector got an error: NSCannotCreateScriptCommandError"
- if I try to use the defined terminology (which gets reported out as shown above, I get a compilation error
set org to organizer of document 1
...I get a compilation error "Unexpected end of line, etc. but found identifier."
...
---------------------------------------
My objectSpecifier method:
- (NSScriptObjectSpecifier *)objectSpecifier
{
NSScriptObjectSpecifier *containerRef = [[self repository] objectSpecifier];
NSPropertySpecifier *spec = [[NSPropertySpecifier allocWithZone:[self zone]] initWithContainerSpecifier:containerRef key:@"rootOrganizer"];
return spec;
}
---------------------------------------
Script and terminology files available on my iDisk public folder to keep this message at an acceptable length:
http://homepage.mac.com/dougknowles/ScriptProblem/ _______________________________________________
_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden This email sent to email@hidden
| References: | |
| >Scripting support problems (From: Doug Knowles <email@hidden>) | |
| >Re: Scripting support problems (From: Dustin Voss <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.