[Pythonmac-SIG] Publicity opportunities
has
hengist.podd at virgin.net
Wed Aug 18 22:04:24 CEST 2004
Cameron Laird wrote:
>I'm in a position to use a few paragraphs of
>Applescript material. I can take anything *you* find interesting
>about Applescript (and Python)--general principles, specific
>scripts that do neat things, whatever.
You mean the AppleScript language in particular or Apple event-based
InterApplication Communication in general?
The AppleScript language isn't all that interesting, 'cept maybe as a
pathological study case for language designers. Its only advantage
over other scripting languages is that it currently has better OSA
support than any other language; partly because OSS languages have
been slow to support it (and often do a pretty poor job of it),
partly because OS X's support for third-party OSA languages is
second-rate at best.
High-level Apple event-based IAC is a killer technology, though its
practical use is complicated by huge variations in the quality and
style of application interfaces and implementation, and still greatly
undersupported. Though it's still way ahead of what's available on
other platforms, mind you (although they are closing the gap).
If you want to summarise it: local/LAN-based RPC with typed data
(including support for type coercions), and vaguely OPath-like
query-based mechanism for specifying application objects [1] as
represented by the Apple Event Manager object model (basically a thin
View+Controller over the application's Model layer; in Cocoa apps,
this is provided for free by the Cocoa frameworks and typically
reflects the actual Model structure closely; in Carbon apps
developers had to hook it all together themselves).
As for MacPython, its original AE support (aetools, gensuitemodule)
is pretty third-rate, little used and due for replacement, so I
wouldn't suggest going there. Bob started working on aeve as a
replacement last year; I turned up a few months later, identified
various problems in aeve and started work on appscript, which is
loosely slated as the eventual replacement to aetools and company.
(Had hoped it would be ready in time for MacPython 2.4, but now looks
like it'll be 2.5 before it's sufficiently fit for inclusion.)
The current version of appscript, 0.5.0, is reasonably complete,
moderately usable and sufficiently well documented that someone with
experience in application scripting on Frontier or AppleScript can
use it quite successfully. (There's a stack of examples on my site if
you want to take a look.) However, it does have problems (mostly
caused by bugs in applications' terminology, which it's very
sensitive to, and weaknesses in Apple's terminology formats/API in
general) and omissions (mostly due to my own laziness and lack of
deep C skills meaning it's still not finished), and the architecture
is dreadfully non-extensible (my first attempt, after all), which
means the next version (which I'm working on the now) is a complete
rewrite (although its highest-level API should remain more or less
identical to the current one).
If you really want to discuss stuff some more, I can probably be
arm-twisted into it. However, three caveats: 1. I'm not interested in
discussing the AppleScript language itself, so if all you want is to
execute AppleScript code from Python you're better off asking on one
of the AppleScript-oriented mailing lists for which I can give you
directions; 2. appscript isn't finished, so if you want to refer to
it directly I can't guarantee I won't rip out and replace the API the
day after you go to press; and 3. ORA and I have some bad history
between us (I had a breakdown last year while writing an AppleScript
book for them, which totalled the project) so may be persona
non-grata as far as they're concerned (you may want to check with
their Mac editor first; if he turns colours it's probably a bad idea).
HTH
has
[1] Note: a LOT of folk mistake application object reference forms
for conventional OO references due to their syntactic similarity in
AppleScript - this is wrong, and an unfortunate consequence of its
heavy use of syntactic sugar in clumsy attempts to appear simple and
user-friendly.
--
http://freespace.virgin.net/hamish.sanderson/
More information about the Pythonmac-SIG
mailing list