Re: Scripting, OSA style
Re: Scripting, OSA style
- Subject: Re: Scripting, OSA style
- From: Brian Webster <email@hidden>
- Date: Mon, 8 Apr 2002 09:40:14 -0500
On Monday, April 8, 2002, at 08:35 AM, cocoa-dev-
email@hidden wrote:
So I have a few questions:
Where can I find information about OSA?
Well, MacTech is definitely a good place to start. There are at
least a couple other good articles in addition to the one you
mentioned, one called "Inheritance in Scripts" goes further into
using the OSA API. And of course there's Apple's
documentation. There's not really anything in the OS X/Carbon
version of the docs, but if you go to the OS 8/9 developer docs
page, you'll find the Inside Macintosh coverage of OSA,
basically all of which is still applicable on OS X. It actually
explains how OSA actually works, rather than just giving you a
list of functions with no explanations. (really, how hard is it
to copy and paste the Inside Mac docs over to the Carbon
section?) There is also some pretty good sample code on the
developer site; MenuScripter comes to mind as a good one with
pretty in-depth functionality - look under the interapplication
communication section.
How would one go about writing code to call OSA scripts?
The OSA APIs have functions for loading, compiling, and
executing OSA scripts, including non-Applescript. You can call
these functions from Cocoa with no problem, since they're just
plain C calls.
How can I implement a library of common code that can be called
from any
OSA script?
Make your application scriptable, then any OSA script can access
its functionality. You could also write a scripting addition,
which can be a little tricky. Also, the WWDC 2002 Applescript
update session mentions a new model that will replace scripting
additions in OS X, so you might want to check that out when it
comes about.
Is OSA what I should even be looking at, or should I go for XML-RPC, or
some other way to distribute all of these?
Well, it is true that OSA scripts won't work on non-Mac
platforms. If you only care about supporting Macs though, then
OSA is the easiest way to go.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.