• 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: passing parameters to an AppleScript from Objective-C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: passing parameters to an AppleScript from Objective-C


  • Subject: Re: passing parameters to an AppleScript from Objective-C
  • From: Nathan Day <email@hidden>
  • Date: Fri, 18 Feb 2005 19:15:19 +1100

Look at me NDAppleScriptObject project on my web site, it includes a category of NSAppleEventDescriptor which makes it easy to create event to call handlers with positional arguments or labelled arguments it also can automatically convert to and from Objective-C classes and NSAppleEventDescriptors (NSArrays to/from lists, NSDictionarys to/from records, NSStrings to/from text, NSNumber to/from numbers etc). You are free to just use the category.

On 17/02/2005, at 4:17 AM, Daniel Morrow wrote:

Dear list,

I'm a recent convert from Carbon-land, and I'm still feeling my way around Cocoa. So, please excuse my ignorance.

I have an app which includes an AppleScript file. I want to load and execute the script, but also pass a parameter to it.

If I had no parameters, I think I'd do something like this:

NSDictionary* theDict = [NSDictionary new];
NSAppleScript* exportDataScript = [[NSAppleScript alloc] initWithContentsOfURL:exportDataScriptURL error:&theDict];
NSAppleEventDescriptor* desc = [exportDataScript executeAndReturnError:&theDict];


The parameter I'm passing is an AEDescList, if that makes any difference.

Nathan Day
email@hidden
http://homepage.mac.com/nathan_day/

_______________________________________________
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: 
 >Formatting integer value (From: RenĂ© Korthaus <email@hidden>)
 >Re: Formatting integer value (From: Charlton Wilbur <email@hidden>)
 >Re: Formatting integer value (From: "M. Uli Kusterer" <email@hidden>)
 >Re: Formatting integer value (From: Andreas Mayer <email@hidden>)
 >Re: Formatting integer value (From: "M. Uli Kusterer" <email@hidden>)
 >OT: "metric" time (From: Andreas Mayer <email@hidden>)
 >Re: OT: "metric" time (From: Shawn Erickson <email@hidden>)
 >passing parameters to an AppleScript from Objective-C (From: Daniel Morrow <email@hidden>)

  • Prev by Date: NSView and NSText in command non-GUI app
  • Next by Date: Listening to bindings
  • Previous by thread: Re: passing parameters to an AppleScript from Objective-C
  • Next by thread: Re: Formatting integer value
  • Index(es):
    • Date
    • Thread