Re: AppleScript create command
Re: AppleScript create command
- Subject: Re: AppleScript create command
- From: "James J. Merkel" <email@hidden>
- Date: Mon, 12 Jul 2004 22:44:00 -0700
On Jul 12, 2004, at 11:07 AM, Dustin Voss wrote:
On 12 Jul, 2004, at 9:06 AM, James J. Merkel wrote:
I'm writing my own create command and have made some progress, but
have run up against a roadblock.
...
And the objectSpecifier is as follows (copied from previous posts on
similar topics):
- (NSScriptObjectSpecifier *)objectSpecifier {
NSScriptObjectSpecifier *containerRef = [NSApp objectSpecifier];
return [[[NSIndexSpecifier alloc]
initWithContainerClassDescription:[containerRef
keyClassDescription] containerSpecifier:containerRef key:@"metadata"
index:0] autorelease];
}
As shown in the console output, I am not able to use the AppleScript
object in a get statement.
Also, I notice in Script Editor that I get: +class ; 1 shown after
running the extract command. Not sure this is correct.
Anyone see what is wrong with what I have done?
Yeah, the -objectSpecifier method won't work properly. The object
specifier for NSApp is actually nil. Try (NSScriptClassDescription
*)[NSApp classDescription] instead of [containerRef
keyClassDescription].
Ok that fixed at least one thing -- Script Editor now shows metadata 1
as the returned value after running the extract command. However, I
still can't use get (or set) commands on my object. I still get an
"NSInternalScriptError" error on these commands. It seems like AS
commands are not getting to my object. Are AS commands sent to the
NSApplication and I have to somehow forward them to my object?
Jim Merkel
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.