Avoid the dictation box

When I find myself writing or editing something sufficiently long, I like to have full support for Select-and-Say. I used to use “open dictation box”, since that’s the obvious choice, until I discovered that using Notepad is much faster.

It’s kind of unbelievable that forking a process and starting a third-party editor could be faster than using the feature Nuance designed for this precise purpose. But amazingly it is, by a factor of about 2X! By my measurements, the dictation box starts up in about two seconds, whereas Notepad starts up in one. Transferring text from the dictation box takes about one second versus a half second for Notepad.

Just bind a few commands to make Notepad as easy to use as the dictation box:

from dragonfly import *
from dragonfly.windows.window import Window

class RunApp(ActionBase):
    """Starts an app and waits for it to be the foreground app."""

    def __init__(self, *args):
        super(RunApp, self).__init__()
        self.args = args

    def _execute(self, data=None):
        WaitWindow(None, os.path.basename(self.args[0]), 3).execute()

class UniversalPaste(ActionBase):
    """Paste action that works everywhere, including Emacs."""

    def _execute(self, data=None):
        foreground = Window.get_foreground()
        if foreground.title.find("Emacs editor") != -1:

# In your universal grammar:
    "edit text": RunApp("notepad"),
    "edit everything": Key("c-a, c-x") + RunApp("notepad") + Key("c-v"),
    "edit region": Key("c-x") + RunApp("notepad") + Key("c-v"),

# In your Notepad grammar:
    "transfer out": Key("c-a, c-x, a-f4") + UniversalPaste(),

# To get Emacs support, put something like this in your .emacs file:
(setq frame-title-format
         (dired-directory dired-directory "%b"))
        " - %m"
        " - Emacs editor"))

This gives you commands to start an editing session from several contexts: from nothing, from a selection, or from everything in your current field. And you get an easy way to transfer it out which works perfectly well with Emacs. Also, unlike the dictation box, this doesn’t prevent you from interacting with the existing app you have open (e.g. to visit another tab in Chrome). And if you accidentally mess up and paste it to the wrong place, it is still in your clipboard so you can easily recover it.

Of course, this same technique would work with another editor, it just needs to start up quickly and have full Select-and-Say support. Ideally, I would use it with an editor that has unlimited undo history. And if the editor can start in the background, this could be even faster by avoiding the process fork. If anyone knows a good candidate, please post in the comments!

3 thoughts on “Avoid the dictation box”

    1. Good point. I suppose WordPad could be used if this is needed. From an informal test I just did it looks like it does start more quickly than the dictation box.

  1. I have this functionality kinda wrapped up in my commands. I can select words by saying “select ” so long as it’s on the same line, then just speak over it. I can go to before or after any word, letter, or series of letters. I can select from the cursor, left or right through any word, letter, or series of letters.

    I personally just want to do it all directly. From the beginning I supplanted all of dragon’s functionality. No doubt I have room to extend it further, but that’s what I end up expecting to do.

    Though, different text buffers act different, so that needs to be known about the app your in. For instance, select a word, from left through right, and then when you press the left arrow some will go left of the whole selection, some will go right of the whole selection, and some will be like those but shifted a character further.

Leave a Reply

Your email address will not be published. Required fields are marked *

Markdown is supported. Make sure raw < and > are wrapped in code blocks. You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.