• 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: Adding simple AppleScript commands to a Cocoa application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding simple AppleScript commands to a Cocoa application


  • Subject: Re: Adding simple AppleScript commands to a Cocoa application
  • From: Jim Correia <email@hidden>
  • Date: Sun, 16 Apr 2006 10:09:11 -0400

On Apr 16, 2006, at 9:46 AM, Robert Nolet wrote:

This all works exactly as I want it to, however I think that creating a subclass of NSScriptCommand and then accessing my MyController object by going through the application delegate is an incredibly sloppy and round-about way of achieving this. Also, if I were to add more commands, I would have to create a new class for each command I want to implement. So I am looking for a more elegant way of linking methods in my MyController class to AppleScript commands.

There are two ways to implement a script command: object first dispatch, or verb first dispatch.


<http://developer.apple.com/documentation/Cocoa/Conceptual/ ScriptableCocoaApplications/SApps_script_cmds/chapter_8_section_1.html>

You don't say what MyController is. With object first dispatch, "top- level" commands are going to be dispatched to NSApplication. If MyController is your applications controller and NSApplication delegate, you'll have to forward the commands there either with an NSApplication category, or by using a subclass of NSApplication.

Jim


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Adding simple AppleScript commands to a Cocoa application (From: "Robert Nolet" <email@hidden>)

  • Prev by Date: Adding simple AppleScript commands to a Cocoa application
  • Next by Date: Re: Empty NSStrings, nil NSStrings
  • Previous by thread: Adding simple AppleScript commands to a Cocoa application
  • Next by thread: Re: Adding simple AppleScript commands to a Cocoa application
  • Index(es):
    • Date
    • Thread