On Jun 21, 2004, at 8:50 AM, Jim Tittsler wrote:
> Are there any special tricks to making a PyObjC application
> AppleScriptable? Any examples I can steal from?
It should be mostly the same as you would do it from Objective C. I'm
not sure if anyone has really tried it though, let us know how it works
I can confirm that the low level stuff does work, by that I mean (which
I use to handle outgoing apple events asynchronously):
def applicationDidFinishLaunching_(self, aNotification):
def handleAppleEvent_withReplyEvent_(self, event, replyEvent):
The caveat is that four character codes look like unsigned integers
through the bridge, so you'll probably have to do a fair amount of
struct.pack/unpack as demonstrated above. Also note that Python's
Carbon AEDesc is bridged to -[NSAppleEventDescriptor aeDesc], so if you
want to work with an AEDesc directly (process it with aeve or the like)
then you should be able to just go at it.