appscript

About py-appscript

Please note that appscript is no longer developed or supported, and its use is not recommended for new projects.

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+ or Python 3.1+ and Mac OS X 10.4 or later.

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