KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: How to write DVC commands?
Topic Summary:
Created On: 09/09/2020 04:12 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 How to write DVC commands?   - rob - 09/09/2020 04:12 PM  
 How to write DVC commands?   - Matt_Chambers - 09/09/2020 04:36 PM  
 How to write DVC commands?   - dilligence - 09/09/2020 06:30 PM  
 How to write DVC commands?   - Stephan Kuepper - 09/10/2020 03:19 AM  
 How to write DVC commands?   - rob - 09/10/2020 12:09 PM  
 How to write DVC commands?   - MikeJ - 09/10/2020 04:05 PM  
 How to write DVC commands?   - rob - 09/10/2020 04:28 PM  
 How to write DVC commands?   - rob - 09/15/2020 04:17 PM  
Keyword
 09/09/2020 04:12 PM
User is offline View Users Profile Print this message


rob
Top-Tier Member

Posts: 209
Joined: 11/29/2006

Hi,

 

How do you write DVC commands inside of the Dragon commands editor?

 

I know where to write them within the knowbrainer command editor but I do not know the syntax, so what are the differences in syntax?

 

If I use an advanced scripting command in visual studio code, after the command has deployed Dragon still recognises what I am saying, but there is a delay in deploying every subsequent command or any dictated text, then all the commands and text will deploy all at once after the delay. The longer the advanced scripting command is the longer the delay is, for a command that camel cases something and add some text for example there is around a 15 second delay afterwards. 

 

Normal text and graphics commands deploy with no problems afterwards. So that is why I want to try using DVC commands to see if that gets round the problem.

 

There are no problems in any of the other programs I use using the same commands.

 

Thanks,

Rob

 

 



-------------------------

Dragon Professional Group 15.6 with knowbrainer 2017 professional and speech start.

 09/09/2020 04:36 PM
User is offline View Users Profile Print this message

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 337
Joined: 08/09/2018

You can write a DVC command in the Dragon commands editor by cloning an existing DVC command, such as one of the mousegrid commands.

For the syntax, there is an old PDF document that explains how to write DVC commands. Here's a link: https://www.speechrecsolutions.com/assets/VoiceCmd.pdf. Lunis may have a copy on this site, too.



 09/09/2020 06:30 PM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1262
Joined: 08/16/2010

You may be interested in:

 

The Easy Guide to Dragon Scripting



-------------------------

www.speechproductivity.eu 


Auto Box - SP Editor - HyperNotes - Hotkeys for Dragon - Quick Correct - Press Utility - Easy Guide to Dragon Scripting

 09/10/2020 03:19 AM
User is offline View Users Profile Print this message

Author Icon
Stephan Kuepper
Top-Tier Member

Posts: 2130
Joined: 10/04/2006

+1 for diligence. Great way to start.

-------------------------

www.egs-vertrieb.de - www.spracherkennungscloud.de

 09/10/2020 12:09 PM
User is offline View Users Profile Print this message


rob
Top-Tier Member

Posts: 209
Joined: 11/29/2006

Hi,

Thanks for the information everyone. I have been trying to recreate the following command with a DVC command. The syntax seems ok because the command saved without errors but when I run the command an error message is displayed "fatal exception in interpreter line 4".

When I check the code I don't see the mistake, can someone let me know what is wrong and let me know if there are other mistakes I have made that you could point out a fix for? I will post the code below first the normal advanced scripting command that works and then the DVC command that I am trying to get to do the same thing, that is not currently working.

The command just camel cases what is dictated and then uses the camel cased words in the sendkeys part which is the text for swapping array elements.

 

Sub Main
   Dim camelVariable, dictate, firstCharacter As String
   Dim wasSpace As Boolean
   Dim dictationLength As Integer

   dictate = ListVar1

   dictate = Trim (dictate)' probably unnecessary
   firstCharacter = Mid (dictate, 1, 1)
   firstCharacter = LCase (firstCharacter)
   camelVariable = firstCharacter

   dictationLength = Len (dictate)
   If dictationLength > 1 Then
      For increment = 2 To dictationLength
         firstCharacter = Mid (dictate, increment, 1)
         If firstCharacter = " " Then
            wasSpace = True
         Else
            If wasSpace = True Then firstCharacter = UCase (firstCharacter)
            camelVariable = camelVariable + firstCharacter
            wasSpace = False
         End If
      Next increment
   End If
   Wait 0.1
   SendKeys "int temp = " + camelVariable + ";{Enter}"
   Wait 0.1
   SendKeys camelVariable + " = " + camelVariable + "[i {+} 1];{Enter}"
   Wait 0.1
   SendKeys camelVariable + "[i {+} 1] = temp;{Enter}"
End Sub


(DVC command below)

   dictate$ = _arg1

   firstCharacter$ = Mid$ (dictate$, 0, 1)
   firstCharacter$ = LCase$ (firstCharacter$)
   camelVariable$ = firstCharacter$
   
   dictationLength% = Len (dictate$)
   If dictationLength% > 1 Then
      I = 1
      Do Until I = dictationLength%
         firstCharacter$ = Mid$ (dictate$, I, 1)
         If firstCharacter$ = " " Then 
		firstCharacter$ = Mid$(dictate$, I + 1, 1)
		firstCharacter$ = UCase$(firstCharacter$) 
		camelVariable$ = camelVariable$ + firstCharacter$
		I = I + 1
         Else
            camelVariable$ = camelVariable$ + firstCharacter$
         End If
      I = I + 1
      LOOP
   End If
   Wait 100
   SendKeys "int temp = " + camelVariable$ + ";{Enter}"
   Wait 100
   SendKeys camelVariable$ + " = " + camelVariable$ + " {Shift+=} 1];{Enter}"
   Wait 100
   SendKeys camelVariable$ + "[i {Shift+=} 1] = temp;{Enter}"


 



-------------------------

Dragon Professional Group 15.6 with knowbrainer 2017 professional and speech start.



 09/10/2020 04:05 PM
User is offline View Users Profile Print this message


MikeJ
Top-Tier Member

Posts: 1086
Joined: 10/03/2006

Rob,

Send me a PM on this forum with a good email for you and I can send you a DVC scripting starters kit that I put together a few years ago that you might find helpful.

Mike
 09/10/2020 04:28 PM
User is offline View Users Profile Print this message


rob
Top-Tier Member

Posts: 209
Joined: 11/29/2006

@MikeJ I just PM'd you there.

Can anyone show me where the script is wrong at the moment?

Thanks,
Rob

-------------------------

Dragon Professional Group 15.6 with knowbrainer 2017 professional and speech start.

 09/15/2020 04:17 PM
User is offline View Users Profile Print this message


rob
Top-Tier Member

Posts: 209
Joined: 11/29/2006

Can anyone show me where the script is wrong at the moment?

https://www.youtube.com/watch?v=xRcUFvbcWCw154

 

Thanks,

Rob



-------------------------

Dragon Professional Group 15.6 with knowbrainer 2017 professional and speech start.

KnowBrainer Speech Recognition » Dragon Speech Recognition » How to write DVC commands?

Statistics
31935 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 4 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 494 guests browsing this forum, which makes a total of 498 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2021 FuseTalk™ Inc. All rights reserved.