appscript

About py-appscript

Python appscript (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 document named "ReadMe" in TextEdit:

app('TextEdit').documents['ReadMe'].paragraphs[1].get()

This is equivalent to the AppleScript statement:

tell application "TextEdit"
    get paragraph 1 of document "ReadMe"
end tell

Py-appscript requires Python 2.3+ and Mac OS X 10.3 or later. Python 3.0+ is also supported.

See the installation page to get started. Documentation is available online or as part of the .tar.gz distribution.