Created
September 4, 2012 05:22
-
-
Save gcmurphy/3616916 to your computer and use it in GitHub Desktop.
Sublime Text 2 plugin to read out lout the selected text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
import subprocess, threading | |
def _run(cmd, args): | |
subprocess.call([cmd, args]) | |
class SpeakCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
for region in self.view.sel(): | |
if not region.empty(): | |
cmd = ['espeak', self.view.substr(region)] | |
threading.Thread(target=_run, args=cmd).start() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added this shortcut to the key bindings: