Re: Can the AppleScript implementation of an AS application be exposed via terminology?
Re: Can the AppleScript implementation of an AS application be exposed via terminology?
- Subject: Re: Can the AppleScript implementation of an AS application be exposed via terminology?
- From: Matt Neuburg <email@hidden>
- Date: Tue, 07 Oct 2008 07:46:24 -0700
- Thread-topic: Can the AppleScript implementation of an AS application be exposed via terminology?
On Mon, 6 Oct 2008 11:44:29 -0700, Scott Babcock <email@hidden> said:
>I have a bunch of library functions implemented in AppleScript. This is really
great for providing common functionality to code written in AppleScript, but
these functions aren't available to code written in other languages. Is there
any way to wrap this library suite in such a way as to expose an Apple Event
interface that can be used by code written in other languages (C, Python, Ruby,
etc.)?
>
>I know that AppleScript Studio provides a method for AppleScript code to access
Cocoa functionality, but I need to turn this on its head - to provide access to
AppleScript functionality from Obj-C. I'd need to define my terminology in the
traditional way in my AppleScript Studio application, but then I'd need some way
to connect the terminology to the implementation.
Why not just embed them into an Objective-C Cocoa application and make them
accessible thru a dictionary and Cocoa Scripting? (See the last chapter of
my book to get started writing a scriptable Objective-C app.) Python,
Objective-C, and Ruby can then call them through AppScript. Objective-C can
call into a handler of a script (also explained in that last chapter). Of
course, this raises the question of why bother with AppleScript at all. I
don't know what these library functions do but maybe they would be better
off rewritten mostly or wholly in C/Objective-C if you're going to go this
route.
A different sort of approach might be to make them all accessible thru
handlers in an applet. You can't give a handler a dictionary (a pity) but
you can call handlers in a running applet. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden