I think Writemonkey is the best prose editor out there, it works well with NaturallySpeaking, and 3.0 looks to be amazing – seemingly taking some cues from sublimetext. Unfortunately, it only runs on Windows, and it breaks virtualbox’s and vmware’s clipboard synchronization. Hence, I haven’t been able to use it for a while.
But once I got used to its repository function (i.e., quickly scoot selected text to a repository file) I couldn’t do without. Hence, I have plugins for the two text editors I tend to use the most, sadly, neither of which are free: sublimetext (for its power and speed) and MS Word (for speech dictation). I just realized I’ve never really shared these.
from os.path import abspath, basename, dirname, exists, join, splitext
import sublime, sublime_plugin
import time
# https://www.sublimetext.com/docs/3/api_reference.html
class MoveToRepoCommand(sublime_plugin.TextCommand):
def run(self, edit):
for region in self.view.sel():
if not region.empty():
selection = self.view.substr(region)
date = time.strftime("%Y-%m-%d %H:%M %Z", time.localtime())
chunk = '\n<!-- moved from main text: %s -->\n\n%s\n\n' % (
date, selection)
print(chunk)
fn = abspath(self.view.file_name())
path = dirname(fn)
fn_base, fn_ext = splitext(basename(fn))
fn_repo = join(path, fn_base + '.repo_md')
print('fn_repo = %s' % fn_repo)
if exists(fn_repo):
with open(fn_repo, 'r') as repo:
repo_content = repo.read()
else:
repo_content = ''
with open(fn_repo, 'w') as repo:
repo.write(chunk + repo_content)
self.view.replace(edit, region, '')Sub repo()
Attribute repo.VB_ProcData.VB_Invoke_Func = "Normal.NewMacros.repo"
'
' repo Macro
'
'
Dim fn As String
Dim FSO As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
ChangeFileOpenDirectory ActiveDocument.path
fn = FSO.GetBaseName(ActiveDocument.Name) & ".repo_md"
Debug.Print fn
Selection.Copy
Documents.Open filename:=fn, _
ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
wdOpenFormatAuto, XMLTransform:="", Encoding:=1252
Selection.TypeText ("<!-- moved from main text: ")
Selection.InsertDateTime DateTimeFormat:="yyyyy-MM-dd HH:mm", _
InsertAsField:=True
Selection.TypeText (" -->")
Selection.TypeParagraph
Selection.TypeParagraph
Selection.PasteAndFormat (wdFormatPlainText)
Selection.TypeParagraph
Selection.TypeParagraph
Application.Run MacroName:="Normal.NewMacros.FileSave"
ActiveWindow.Close
Selection.Cut
End Sub
Comments !