Python + AppleScript

O'Reilly Network -- Using Python and AppleScript Together
http://www.macdevcenter.com/pub/a/mac/2007/05/08/using-python-and-applescript-to-get-the-most-out-of-your-mac.html