• 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: How do I call a specific applescript handler and pass arguments?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I call a specific applescript handler and pass arguments?


  • Subject: Re: How do I call a specific applescript handler and pass arguments?
  • From: Jim Correia <email@hidden>
  • Date: Sun, 20 Nov 2005 16:15:09 -0500

On Nov 20, 2005, at 3:55 PM, email@hidden wrote:

I'd like to do something similar, but I can't tell from the NSAppleScript class documentation how I can pass arguments to the handlers inside the script. The only methods I see just do an execute.

This isn't directly built into NSAppleScript. You'll have to write it yourself (a category on NSAppleScript might make sense.)


If you were using OSA directly, you'd use OSAExecuteEvent. It looks like (I haven't done it myself) that NSAppleScript's executeAppleEvent:error: will get you what you want.

http://developer.apple.com/qa/qa2001/qa1111.html

That QA shows you how to build the event. The event should be of type kASAppleScriptSuite/kASSubroutineEvent. The parameters to in keyDirectObject as a list. The subroutine name goes in keyASSubroutineName an should be lowercase.

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: 
 >How do I call a specific applescript handler and pass arguments? (From: email@hidden)

  • Prev by Date: Re: applicationShouldTerminate: still not working
  • Next by Date: Thread context switch
  • Previous by thread: How do I call a specific applescript handler and pass arguments?
  • Next by thread: Re: How do I call a specific applescript handler and pass arguments?
  • Index(es):
    • Date
    • Thread