[Pythonmac-SIG] Quiet lately? Here's a big one....

Jack Jansen jack@oratrix.nl
Fri, 26 May 2000 13:30:48 +0200


Benjamin,
AppleScript will allow you very nice control over any application that 
supports it. Actually, it is not AppleScript per se but the underlying 
stuff, called Open Scripting Architecture. And, as Python can also
generate OSA commands you can indeed control lots of applications from 
Python. There's a short introduction in the "applescript" section in
Python:Mac:Demo (applescript.html, I think it is).

Controlling low-level things, like pressing specific buttons or
selecting certain items from a list in a dialog is not "the official
applescript way", but as it is often useful for controlling
applications that don't (fully) support applescript there are ways to
do this. The two that i know of are QuickKeys and KeyQuencer. Both of
these allow you to put things like "press button labeled "OK" from
topmost dialog" or "type "A"" or such in your applescript (or your
Python script: these things are modeled as applescript extensions, so
you can also call them from Python with a bit of work).

It is indeed a good idea to first read Apple's applescript
documentation. I know that I had quite some difficulty understanding
it at first, because this high-level philosophy is a good idea once
you understand it, but it is rather unlike what any other scripting
language provides.
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm