Hi, I am making a small plugin to send code to other applications such as R, Stata and iTerm. I am using Applescript though the system command osascript to achieve this. When I want to reactivate Sublime Text 2 through applescript, it crashes. Below is a minimum example. Any suggestions?
[code]import sublime, sublime_plugin
import os
class ExampleCommand(sublime_plugin.TextCommand):
def run(self, edit):
cmd = “”“osascript -e ‘tell app “Finder” to activate’ “””
cmd2= “”“osascript -e ‘tell app “Sublime Text 2” to activate’ “””
os.system(cmd)
os.system(cmd2)[/code]