• 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: Applescript in Cocoa - problem with custom command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript in Cocoa - problem with custom command


  • Subject: Re: Applescript in Cocoa - problem with custom command
  • From: John Nairn <email@hidden>
  • Date: Mon, 15 Sep 2003 15:57:57 -0600

I find AppleScript a great challenge (see subsequent post) and usually resort to trial and error (and error ...) to get it to work. But supporting commands is one the easier tasks. I have used commands when other ways fail.

I learned to do commands from short article posted by Andrew Stone at:

http://www.stone.com/The_Cocoa_Files/Adding_Applescript.html

See the example "OpenFile" command and replace with what you want for your command.

Just wish he had written more.

On Monday, September 15, 2003, at 02:44 PM, email@hidden wrote:

Hi all...
After reading Apple's abyssmal documentation
on Applescript-Cocoa integration, and searching the
web for tutorials, I've come down to the wall.

I have set up my script suite, created what I think is
a new command, and wrote a test script. Now every time
I run it I get an NSCannotCreateScriptCommandError,
even after trying extensive variations.

I followed the advice of a previous poster on this
list and created a subclass of NSScriptCommand called
TypeInCommand, specified it as my custom command's
superclass, and erased the SupportedCommands section
from my class in the .scriptSuite. Same error.

Anyone have suggestions or, even better, explanations
of how this horrible hack called Cocoa-Applescript
integration is supposed to work?

Thanks!
-Nathan Keeney

------------
John Nairn (1-801-581-3413, FAX: 1-801-581-4816)
Web page: http://www.eng.utah.edu/~nairn
_______________________________________________
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.

  • Prev by Date: Re: Country code or name
  • Next by Date: AppleScript to make different document types
  • Previous by thread: Re: Applescript in Cocoa - problem with custom command
  • Next by thread: Re: cocoa-dev digest, Vol 2 #2921 - 14 msgs
  • Index(es):
    • Date
    • Thread