[Pythonmac-SIG] AppleScript events in Python

Jack Jansen jack@oratrix.nl
Wed, 01 Mar 2000 10:30:07 +0100


> Now if some smart mac person out there can figure out a way to send data back
> to the originator of the event, we'd essentially have a way to write little
> applescript helper apps in our beloved Python.

Check out AEServer.callback_wrapper(). Basically it takes the value returned 
from your handler and aepacks() it. This works "automagically" for simple 
types like strings, ints, fsspecs, etc. (i.e. you return the Python value and 
it all works). If you need to return a value in a way that the automatic 
packing of aepack won't understand you can create a class with an __aepack__ 
method and return an instance of that.
--
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