State of Python scripting on Mac OS X?

Francis Avila franga at shentel.net
Wed Mar 24 18:42:04 EST 2004


I just got a Mac, and I want to script it using Python.  (I tried a few
things with AppleScript, but I swear it's like COBOL++, and the data types
are very cumbersome to use.) Since Apple has Python out of the box, I
thought it would support scripting OOTB too, but apparently not.  Python
needs an OSA scripting component to be an OSA-compliant language.  I'm not
entirely clear on what that means, though, because OSA seems to sometimes
refer to an API, sometimes to an IPC, and sometimes to a "component".

Searching around I get old and/or conflicting reports on what constitutes
OSA support, whether there's a package that gives Python such support, where
I can get it, and how I can make the OS recognize it.  For example, I can't
get an answer to a question as simple as how one can select Python in the
Script Editor, and what relation this has to OSA.  I can't seem to find a
nice architectural overview of OSA.  Or, would I be able to use the Python
standard library, or only the events that other Applications provide? And so
on.

The best I can seem to find now is PyObjC, which is lower-level than what I
want. Other things I turn up (the AppScripting package or the MacPython IDE)
seem to provide some sort of interface to OSA, but not an OSA component
itself.  Or at least that's what they seem to be claiming.  (In any case,
these never show up in script editor as an "OSA".)

So I guess I'm asking if anyone knowledgeable can point me in the right
direction or tell me the current state of Python for AppleScript-ing.  If
there's a project that's building a "complete" OSA scripting component for
Python, I might be interested in participating.
-- 
Francis Avila




More information about the Python-list mailing list