State of Python scripting on Mac OS X?

has has.temp2 at virgin.net
Thu Mar 25 10:14:36 EST 2004


Francis Avila <franga at shentel.net> wrote in message 
news:<BC8786FC.F36%franga at shentel.net>...


> Python needs an OSA scripting component to be an OSA-compliant language. 
> I'm not entirely clear on what that means, though, 

Neither are Apple.:p The term "OSA" is commonly used to refer to both
the IAC-related Carbon APIs as a whole and to the specific API used to
create scripting language components.

You're correct that MacPython isn't OSA-compliant, but this isn't that
a big deal. Currently, the only real benefit of OSA support [1] would
be the ability to edit Python scripts in OSA-savvy editors such as
Script Editor, Smile and Script Debugger. OSA support isn't needed to
control applications, however - for this you use the Apple Event
Manager.

MacPython provides a low-level bridge to the AEM as part of its Carbon
API wrappers. The current distribution (2.3.x) also includes a number
of modules that wrap this bridge in a higher-level API: aepack,
aetools, aetypes and gensuitemodule. These modules will shortly be
deprecated in favour of the new appscript module [2], which provides a
much better high-level API. For now, you can get appscript from my
site:

http://freespace.virgin.net/hamish.sanderson/

Note that the current distribution is source code-based and requires
distutils and the gcc compiler to build it. (A copy of gcc is included
with Apple's Developer Tools if you don't already have it.)

For general discussion of this topic, the PythonMac SIG list is the
best place to be. Or mail me directly if you've any specific questions
on appscript.

HTH

has

--

[1] OSA support is also needed for 'attachability', the ability to
attach scripts to application menus, objects, etc.; terrific stuff for
doing event-driven automation. Unfortunately, the Cocoa Scripting API
used in Cocoa apps currently only supports attachability for
AppleScripts - not much use to anyone else. Feel free to submit a
feature request to Apple on this.

[2] Previously named 'AppScripting'; renamed to 'appscript' as of
v0.4.0. Make sure you get the latest version (v0.4.6) as a lot has
changed since.



More information about the Python-list mailing list