• 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: Send events to AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Send events to AppleScript


  • Subject: Re: Send events to AppleScript
  • From: has <email@hidden>
  • Date: Sat, 21 Mar 2009 00:34:36 +0000

Re: Send events to AppleScript

Is it at all possible to have an application send actions to a
particular AppleScript script,

Yes. See NSAppleScript/OSAKit/Carbon OSA APIs. There's a sample project in the objc-appscript repository, CallAppleScriptHandler, that provides a simple demonstration of calling script handlers from ObjC, using appscript's AEM APIs to simplify the process of converting Cocoa objects to/from NSAppleEventDescriptors.



or set that script as a delegate of that application

Depends exactly what you mean by 'delegation'. The OSA API provides a whole bunch of arcane selectors and callbacks for two-way intra- process integration between application and scripts, but whether it's appropriate/how to use it will depend on exactly what you're trying to achieve.



or to have an AppleScript as a means of communication
between two applications (one of which is mine, and the other isn't)?

Yes, although if you don't need the IPC code to be user-configurable, you'll likely find it simpler to use an ObjC-Apple event bridge: either Scripting Bridge, which is included in 10.5+, or objc- appscript, which you'll need to build yourself, but is more capable, compatible and portable, and doesn't obfuscate everything to heck.


HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: [Q] "auto"-incrementing integer attribute in awakeFromInsert
  • Next by Date: Re: q's regarding appropriate use of core data?
  • Previous by thread: Send events to AppleScript
  • Next by thread: Re: Send events to AppleScript
  • Index(es):
    • Date
    • Thread