[Pythonmac-SIG] Python app with aemreceive is not scriptable

has hengist.podd at virgin.net
Wed Jan 6 10:58:51 CET 2010


Kevin Walzer wrote:

> It appears that Tcl and Python differ in some respects in code execution. Python doesn't appear to return a value from code that is passed to the "exec" statement.

exec evaluates statements, and Python statements don't return values. You'd need to pass global/local dicts to it and exchange values via that.

For what you're doing though, eval() might be a more appropriate choice.

Though personally I'd be looking to add a proper AE API, even if only procedural, so that users can't just run arbitrary code. But that's your decision, not mine.

has

-- 
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net



More information about the Pythonmac-SIG mailing list