0

I am writing a voice command in advanced scripting in Dragon NaturallySpeaking. I would like to access the last element of the recognition history (e.g., to place it in the clipboard, or repeat). How cannot achieve that?

For example, given this recognition history:

naturally history

I would like to have a voice command so that when I say repeat Dragon NaturallySpeaking sends the keys show recognition history.

Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501
  • See my answer, but, if you say "ninety one point zero" you would normally get Dragon to type "91.0". If you repeat that, and copy from the recognition history, Dragon will only type "ninety one point zero" rather than recognize it and apply the auto-formatting to convert to digits. – PGilm Mar 14 '17 at 13:53

1 Answers1

0

Well, I don't know if this is what you intend, but whatever the command name is will be the last recognition. Do you mean the recognition before that one? That is, the one you said before you say the command? In that case, try the following, but be advised, it's not like saying the phrase again. It's literally copying out what Dragon heard you say (recognized). So if you say at the start of a sentence "this is a test period" to have Dragon type out "This is a test.", your new command will type out "this is a test period".

Sub Main
    Dim engine As New DgnEngineControl
    engine.DlgShow(dgndlgRecognitionHistory,0,,0)  '  Call up Recognition History
    Wait .5  '  Need a short delay
    SendKeys "{Up}", True  '  move up to prior utterance
    SendKeys "{Tab}", True  '  move to utterance selection
    Wait .3
    SendKeys "^c", True  '  Copy to the clipboard
    Wait .5  '  Need a short delay for clipboard
    SendKeys "{Esc}", True  '  Close recognition history
    Wait .3
    SendKeys "^v", True  '  Paste from clipboard
End Sub

To convert the recognition to a newly recognized utterance requires some additional work.

Hth

PGilm
  • 2,262
  • 1
  • 14
  • 26