This code will open a texteditor with the caret positon on a specific
line. Beware of the datefield (last field in the struct) so that you
dont let different editors interfer with your changes to the document.
def openInExternalEditor(self, _filePath, _lnnum, _editor =
'/Applications/TextMate.app'):
from aem.send import Application
import struct
from Carbon.File import FSSpec
SelectionRange=struct.pack('hhllll', 0, int(_lnnum)-1, 1,1,0,0)
Application(_editor).event('aevt',
'odoc',{'----':FSSpec(_filePath),'kpos':SelectionRange}).send()
Thanks for the help, especially Hamish Sanderson who helped me out
(off-list).
Joachim Mårtensson
_______________________________________________
Pythonmac-SIG maillist - Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig