[Pythonmac-SIG] [ann] AppScripting 0.1.0
hengist.podd at virgin.net
Wed Nov 19 04:11:48 EST 2003
>Are you aware of Bob Ippolito's aeve module?
Ran across Bob's module a couple weeks ago, just after I started
writing AS. (We've talked a bit off-list since then, but the two
projects remain separate.)
>Was this done in parallel, or are there specific things you don't
>like about aeve?
Aeve constructs scripting interfaces in much the same way as
gensuitemodule, assembling and compiling source code to create a
bunch of classes and commands to represent the classes and commands
listed in an application's dictionary. This works, but it's rather
complicated and labour-intensive, and it fills your site-packages
folder with a ton of application-specific gsm-generated modules which
seems a bit untidy.
The trick is that when a user interacts with OSA they're not
manipulating an actual object model, merely an interface that looks
like one. All you need do is model the OSA interface - i.e. the
half-dozen reference forms provided by OSA and the command calling
mechanism (see ScriptingInterface.py) - then use Python's whizzy
introspection facilities to make objects appear to have the various
attributes described by a given application's aete. This gives a
simpler, one-size-fits-all solution.
>The one very great advantage of your stuff is that it is pure
>python, but aeve is better than AppScripting in a couple of areas:
>better handling of getting at the aete and it generates
Heh, well Bob's had a bit of a head start on me;). Both are on the
to-do list though.
More important stuff includes figuring out how to create
typeAppSignature AEDescs (or equivalent) for apps like Address Book
that don't have creator codes, and how best to implement the user
interface for the by-test reference form (aka 'whose clauses').
I'm also curious if folk find the app() constructor fast enough or if
I'll need to optimise it. (It shouldn't cause too big an overall
performance hit if you only call it once per app needed and store the
result in a variable, but it is a bit on the slow side for my tastes.)
More information about the Pythonmac-SIG