[Pythonmac-SIG] [ann] PyOSA 0.1.0, Appscript Installer 1.5.1 released
hengist.podd at virgin.net
Tue Mar 27 21:39:54 CEST 2007
On 27 Mar 2007, at 17:35, Kevin Walzer wrote:
>> Announcing the first release of PyOSA, a new OSA language
>> component for Python.
> I'm confused--how is this different from appscript?
In a nutshell, PyOSA makes Python a *full* peer to AppleScript.
Appscript is an Apple event bridge, allowing Python scripts to send
Apple events to applications. That's great when you want to control
one process from another, but no help if you need a script that
controls and/or is controlled by its host process. For that level of
integration/interaction, you need a full OSA language.
PyOSA packages the Python interpreter as an OSA language component,
allowing Python scripts to be attached to any OSA-aware application.
It also fully integrates appscript, allowing PyOSA scripts to send
events directly to the host process and vice-versa. Attachability and
integrated Apple event support are essential for tasks like Folder
Actions and Mail rules, which you just can't do with appscript alone.
For example, you could create a Mail rule that runs an 'AppleScript'
action whenever new messages are received. That rule would load a
PyOSA script and call its 'perform_mail_action_with_messages'
function, passing it a list of message references. The script could
then go through those messages, getting and setting their properties,
moving them to other mailboxes, and so on.
Cool stuff, in other words, and even this is a relatively trivial
example of OSA's full potential. Unfortunately, for various
historical reasons, OSA has never seen widespread adoption beyond the
AppleScript language and a relatively small number of applications.
But hopefully a new generation of OSA language components will begin
to change this situation for the better.
More information about the Pythonmac-SIG