Script commands and the application object
Script commands and the application object
- Subject: Script commands and the application object
- From: email@hidden
- Date: Wed, 20 Mar 2002 01:40:42 -0800
I've got a script command defined on my application object. It uses
NSScriptCommand, and corresponds to a custom selector, timedCopyImage:.
It's very simple; no arguments, no return value. I've implemented that
selector, made it do what it should do, and (after logging several bugs
on Apple :->) everything works fine.
The only objection I have is that I'd like my app *delegate* to be
declaring this method, the same way I have it handling my key-value
coding using application:delegateHandlesKey:. But I can't find any way
to do this; it seems like my delegate has no way of getting in the loop
for script commands. I don't really like having this stuff in my
NSApplication subclass; it just has to talk to the delegate to get any
of its work done anyway.
Is there a mechanism I'm missing that allows me to do this? I've been
combing the doc for one, but it's not jumping out at me...
Oh, and by the way: my command has no arguments, but I can't get
Script Editor to stop displaying it as "timedCopyImage reference --
the object for the command". Invoking it simply as "tell application
'Constrictor' timedCopyImage end tell" works fine, it really has no
argument. Why is Script Editor doing this? Is this a bug, or a
subtlety of AS I'm ignorant of?
Thanks in advance. I'm getting this stuff nailed down bit by bit, but
it certainly is new territory for me...
Ben Haller
Stick Software
_______________________________________________
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.