On Jan 29, 2005, at 19:40, Joachim Mårtensson wrote:
Hello everyone.
I am trying to figure out how to send appleevents to an external program. What I want to accomplish is to open a text document in a editor that supports the external editor protocol as described here http://www.codingmonkeys.de/techpubs/externaleditor/ pbxexternaleditor.html.
Here is my code so far, What am I doing wrong? _filePath is the path to the file and _lnnum is the line number where I want to place the caret. I am using PyObjc but no api in cocoa seems to exist so I use various other modules.
PyObjC can use AppleScript with the NSAppleScript class <http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Classes/NSAppleScript.html>. However, the best way to send Apple Events from Python is probably appscript <http://freespace.virgin.net/hamish.sanderson/appscript.html>. The standard library support for Apple Events is very... raw, so I wouldn't recommend that approach to anyone :)
-bob
_______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig