Search code examples
naturallyspeaking

How can I call another voice command with advanced scripting?


I am writing a voice command using Advanced Scripting in Dragon NaturallySpeaking 12.5 professional (Windows 7 SP1 x64 Ultimate). How can I call another voice command?


Solution

  • You can use the command HeardWord.

    E.g. if you want to call the command my voice command then you can call it from another advanced script as follows:

    Sub Main
    HeardWord "my", "voice", "command"
    End Sub
    

    Another example, say you want to automatically write down [name](link) assuming that you have link as the most recent clipboard and name as the second most recent clipboard (using Ditto to manage the clipboard history), you can use the command:

    Sub Main
        originalClipboard = Clipboard
        SendKeys " ["
        HeardWord "paste", "two"
        Wait(1)
        Clipboard("](" & originalClipboard & ")")
        SendKeys "^v"
        Wait(1)
        Clipboard(originalClipboard)
    End Sub