Re: custom AppleScript command and NSApp delegate
Re: custom AppleScript command and NSApp delegate
- Subject: Re: custom AppleScript command and NSApp delegate
- From: Shaun Wexler <email@hidden>
- Date: Wed, 5 Nov 2003 20:38:49 -0800
On Nov 5, 2003, at 5:03 PM, Christopher Corbell wrote:
My app currently uses the default NSApplication object
and an application delegate object which is the app's
central controller.
I would like to add some custom AppleScript commands
which will basically map to application-level commands.
The application should be the target for these
commands in the AppleScript suite definition, i.e. I
don't want to expose the application's delegate class,
and the users's script should just say something like
tell application "theApp"
DoSpecialCommand
end tell
Do I have to subclass NSApplication in order to accomplish
this? Is there any way to get an NSScriptCommand object and
handler invocation forwarded to the application's delegate,
without exposing the delegate class in the script suite?
E.g., does the AppleScript machinery invoke some intermediate
call like doCommandBySelector: that a delegate might intercept?
Or have I entirely overlooked another way to do this
with the Foundation AppleScript mechanisms?
See the NSApplication documentation:
- (BOOL)application:(NSApplication *)app delegateHandlesKey:(NSString
*)key;
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
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.