[Pythonmac-SIG] ANN: aeve 0.0.1 - Pythonic Apple Event support
Bob Ippolito
bob at redivi.com
Fri Jul 25 02:02:49 EDT 2003
For those of you that like yourselves too much to attempt
gensuitemodule, I've been working on a replacement that's a few orders
of magnitude easier to use. Basically, this lets Python do most things
you could do from Script Editor in a very dynamic way.
You can fetch it at:
http://undefined.org/python/aeve-0.0.1.tgz
aeve does not require you to spit out a bunch of py files before
talking to an app, it's as easy as this:
import aeve
iTunes = aeve.talkto('/Applications/iTunes.app')
print iTunes.current_track.name
Of course, for those great applications that have broken aevt
dictionaries, you can use the compiler to generate .py files, like this:
cd aeve/scripts
./compiler.py -o . /Applications/iTunes.app
Which will spit out a python package called iTunes, with all of the
relevant .py files. It's not quite pretty printed, but it's good
enough to fix things (for example, adding the undocumented artwork
element to the track class).
The latest feature, which I just finished a few minutes ago, is html
documentation. Here's an example:
http://undefined.org/python/aeve/iTunes_doc/
As you can tell, I was pretty uninspired and copied the look and feel
of Script Editor's dictionary. This documentation was spit out with
the following:
cd aeve/scripts
./aevedoc.py /Applications/iTunes.app
There are currently two example scripts included:
missingTrackFinder.py - seeks out and destroys file tracks in your
playlist whose file is missing (there are plenty of status and question
dialogs, so it's pretty safe)
spamStatusMessage.py - a little script I've been using to set my iChat
status message to the number of spams I've filtered _that day_. Most
people probably don't have the same Mail.app structure as I do, but
it's rather easy to change around if you want to play.
If you get a chance to play with aeve, I'm looking for feedback/bug
reports - especially from those of you that have used or are using
gensuitemodule, or have never used Apple Events.
-bob
More information about the Pythonmac-SIG
mailing list