[Pythonmac-SIG] [ann] aemtypes+aemsend 0.1.1 posted

has hengist.podd at virgin.net
Fri Aug 27 16:49:36 CEST 2004


Hi all,

Unfinished, but there's some example scripts included that should 
give a fair idea of how it works:

http://freespace.virgin.net/hamish.sanderson/aem-0.1.1.tar.gz

Example:

	from aemtypes import *
	from aemsend import *

	#get version of application "TextEdit"

	textedit = Application('/Applications/TextEdit.app')
	event = textedit.event('core', 'getd', {'----':app.property('vers')})
	version = event.send()


Notes:

- Nicely object-oriented API. Quite pleased with its usability, 
though the documentation on constructing references needs work as 
usage isn't at all obvious from Specifier classes alone. Probably 
needs a 'How-To' guide or something to walk new users through the 
theory and techniques.

- I've decided to go with three packages for the base aem (Apple 
Event Manager bridge) layer:

	- aemtypes: encodes and decodes basic types and object specifiers
	- aemsend: constructs and sends Apple events to local and 
remote applications
	- aemreceive: handles incoming Apple events (basically an 
updated MiniAEFrame)

- I've given up on earlier plans for aemtypes' object specifier 
classes to be [easily] extensible, and will instead implement the 
terminology-driven appscript layer using composition and delegation 
instead of inheritance/mixins.

- If anyone has an example of MiniAEFrame in use, say as part of a 
simple BundleBuilder-based app, any chance I could take a peek?

- Also, any pointers to info and examples on designing application 
Model layers in Python would be useful; trying to work out how best 
to implement a 'Python Scripting' framework a-la Cocoa Scripting, and 
how it could hook up to a Python-based application's object model.

Questions, brickbats, etc. to the usual address.

Cheers,

has
-- 
http://freespace.virgin.net/hamish.sanderson/


More information about the Pythonmac-SIG mailing list