Oh, thanks, I'm almost there:[code]import sublime, sublime_plugin, os
def run(self, view):
window = self.view.window()
new_view = window.open_file('D:\Doc\Temporary\xxx.txt')
sublime.set_timeout(lambda: self.select_text(new_view), 10)
def select_text(self, view):
if not view.is_loading():
sublime.status_message('this line is processed')
sels = self.view.sel()
new_sels = ]
for sel in sels:
for sel in new_sels:
I got the sublime.status_message('this line is processed') works. But the subsequent line doesn't select the text 'abc'.
So, the trouble portion is reduced to only a few lines. Sorry for being dumb, but please help me with the final lines.