
Py-appscript is a high-level, user-friendly Apple event bridge that allows you to control scriptable Mac OS X applications using ordinary Python scripts.
For example, to get the value of the first paragraph of the topmost document in TextEdit:
app('TextEdit').documents['Read Me'].paragraphs[1].get()
This is equivalent to the AppleScript statement:
tell application "TextEdit"
get paragraph 1 of document "Read Me"
end tell
Py-appscript requires Python 2.3+ and Mac OS X 10.3 or later.
Please note that while py-appscript uses regular object-oriented Python syntax, because it's a bridge to the query-driven Apple Event Manager there are some differences in how it behaves. Check the appscript manual for more information.
PyOSA is an OSA language component for Python that includes support for sending and receiving events via py-appscript.