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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com