• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: custom AppleScript command and NSApp delegate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >custom AppleScript command and NSApp delegate (From: Christopher Corbell <email@hidden>)

  • Prev by Date: Re: Property list invalid for format
  • Next by Date: Multiple Views in a Single Drawer??
  • Previous by thread: custom AppleScript command and NSApp delegate
  • Next by thread: crash when getting AppleScript dictionary
  • Index(es):
    • Date
    • Thread