KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: converting command to DVC some advice?
Topic Summary:
Created On: 09/12/2020 11:53 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 converting command to DVC some advice?   - rob - 09/12/2020 11:53 AM  
 converting command to DVC some advice?   - Mav - 09/16/2020 06:42 AM  
 converting command to DVC some advice?   - rob - 09/16/2020 08:38 AM  
 converting command to DVC some advice?   - rob - 09/16/2020 09:00 AM  
 converting command to DVC some advice?   - R. Wilke - 09/16/2020 08:23 AM  
 converting command to DVC some advice?   - R. Wilke - 09/16/2020 11:05 AM  
 converting command to DVC some advice?   - rob - 09/16/2020 02:28 PM  
 converting command to DVC some advice?   - rob - 09/16/2020 04:04 PM  
 converting command to DVC some advice?   - Mav - 09/17/2020 03:31 AM  
 converting command to DVC some advice?   - Mav - 09/17/2020 03:41 AM  
 converting command to DVC some advice?   - kkkwj - 09/16/2020 08:44 PM  
 converting command to DVC some advice?   - rob - 09/17/2020 05:13 AM  
 converting command to DVC some advice?   - Mav - 09/17/2020 05:25 AM  
 converting command to DVC some advice?   - R. Wilke - 09/17/2020 05:35 AM  
 converting command to DVC some advice?   - rob - 09/17/2020 07:21 AM  
 converting command to DVC some advice?   - R. Wilke - 09/17/2020 07:40 AM  
 converting command to DVC some advice?   - rob - 09/17/2020 07:45 AM  
 converting command to DVC some advice?   - R. Wilke - 09/17/2020 08:20 AM  
Keyword
 09/12/2020 11:53 AM
User is offline View Users Profile Print this message


rob
Advanced Member

Posts: 197
Joined: 11/29/2006

Hi,

 

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/16/2020 06:42 AM
User is offline View Users Profile Print this message

Author Icon
Mav
Top-Tier Member

Posts: 205
Joined: 10/02/2008

Hi!

After an initial glance I didn't see anything wrong with the DVC script, but it appears as if the DVC interpreter is very instable in 15.6 (e.g. most of the mousegrid commands result in an error which eventually locks up Dragon and all applications it's got its hands on, basically forcing you to reboot).

Why don't you stick with the "regular" advanced scription implementation?

 

hth,

mav

 09/16/2020 08:38 AM
User is offline View Users Profile Print this message


rob
Advanced Member

Posts: 197
Joined: 11/29/2006

Hey, thanks for the replies! Yeah it could be that, but don't know why I am getting that specific error on line 4 "fatal exception in interpreter line 4", as that would suggest there is a specific error there it doesn't like. And from what info I have on DVC the syntax on that line seems ok, but I know very little about DVC so I could be talking rubbish!

 

@Mav I don't really use mousegrid but I tried it there and it seemed to work ok.

 

@RWilke yeah I thought LCase$ and UCase$ were listed as valid DVC but it doesn't seem to like it. Also thanks for giving it a try!

 

I do normally stick with the regular advanced scripting commands but they are not deploying correctly when I have to use visual studio code.

 

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(sometimes the delay only starts after the next command or dictation is deployed), 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.

I shortened the DVC command to the last easy bit of what I was trying to do and that part did deploy correctly, the code is below.

 

   SendKeys "int temp = " + _arg1 + ";{Enter}"

   Wait 100

   SendKeys _arg1 + " = " + _arg1 + "[i {Shift+=} 1];{Enter}"

   Wait 100

   SendKeys _arg1 + "[i {Shift+=} 1] = temp;{Enter}"

 

Although I get the same delay after it deploying in visual studio code that I described above, so DVC commands don't get round the problem.

 

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

 

I checked the nsuser.ini file and I don't see an entry for compatibility module status so maybe that is the problem. 

 

I think the normal advanced scripting commands deployed without a problem before in visual studio code so something must have changed but I'm not sure what. It could have been a Windows update or I'm not sure what.


Anyone have any ideas of what settings I could change in the nsuser.ini file or maybe in visual studio code that would work or whatever?

 

 

 

 

 



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

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



 09/16/2020 09:00 AM
User is offline View Users Profile Print this message


rob
Advanced Member

Posts: 197
Joined: 11/29/2006

Oh yeah here is what is in my nsuser.ini file if that is any use 

 

I would enter Compatibility Module Status for visual studio code myself but don't want to enter the wrong thing and maybe mess it up more.

 

[firefox|79.0\Compatibility Module Status]
Global Dictation=1

[.Global\Global Dictation Level]
EXCEL7=0
Internet Explorer_Server=-2

[Settings]
Last DragonBar Mode=3
Small DragonBar Auto Collapse=0
System Has Sound Card=1
Current User=1
Last Audio White List Update YMDHR=_2020_9_11___13___0_
Language and Dialect=1,2
User Base Directory=C:\Users\1\AppData\Local\Nuance\NS15\Users
User Base Directory RU=C:\Users\1\AppData\Local\Nuance\NS15\Users
Last Used User=1
Last Speaker=1
UserTopicsMRU=General - Large
UserMRU=C:\Users\1\AppData\Local\Nuance\NS15\Users\1
New Dragonbar Last Position as Default=61,0
Firefox user has seen RIA support page=1
Microsoft Edge user has seen RIA support page=1
Chrome user has seen RIA support page=1
Modern DragonBar Collapse Mode as Default=1
Is Dictation Available=1

[msedge|84.0\Compatibility Module Status]
Global Dictation=1

[PointNClick|3.0\Compatibility Module Status]
Global Dictation=1

[KBPro|1.0\Compatibility Module Status]
Global Dictation=1

[chrome|84.0\Compatibility Module Status]
Global Dictation=1

[firefox|80.0\Compatibility Module Status]
Global Dictation=1

[msedge|85.0\Compatibility Module Status]
Global Dictation=1

[2_1_container\Compatibility Module Status]
Global Dictation=0

[chrome|85.0\Compatibility Module Status]
Global Dictation=1


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

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

 09/16/2020 08:23 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7242
Joined: 03/04/2007

Rob, I find it quite astonishing that none of the resident scripters around here have taken the bait to provide an answer to your quest so far, even after you posted it a couple of times already.

Last weekend, when I had some spare time, I gave it a try, just out of curiosity. All I can say is that the offending line is the one with the LCase$ instruction, as the message clearly states, and in my testing, it didn't just throw an error message, but also stalled Dragon completely so I had to brute force end task it; repeatedly, also when trying some variations of it, and also when substituting UCase$ for a change.

I am not sure why that is because, both LCase$ and UCase$ are listed as valid DVC instructions according to the legacy DVC documentation.

I didn't look any further then, to admit.



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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage



 09/16/2020 11:05 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7242
Joined: 03/04/2007

Rob, the settings in nsuser.ini are nothing to do with command deployment because they are "just" about dictation and editing support, at best. I have no way of checking this now, but are you sure that the delays really only manifest in VS Code, and not in, for instance, DragonPad, or any other editor? Did you try with another non-supported editor?

If the issue really can be isolated in VS Code, break it down in very small steps, and check them one-by-one, such as using a simple SendKeys statement just typing a literal string first, and then move on to your actual script, but running it line-by-line rather than all at once.



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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage

 09/16/2020 02:28 PM
User is offline View Users Profile Print this message


rob
Advanced Member

Posts: 197
Joined: 11/29/2006

@R. Wilke yeah it does seem to only be in visual studio code. I have tried the same commands in atom and Intellij and they work perfectly with no lag.

I tried a very simple script that just sent SendKeys on a single line and there was a 10 second lag after in the same way as I described above and if I use the normal advanced script I have for camel case there is around 3 second lag afterwards even though there is a lot more code in that.

And as I said the text and graphics commands and dictation all work fine.

It was working briefly earlier in the day in visual studio code but I have no idea why it was working as my setup was the same. So I restarted windows to check if it would also work correctly again and the commands went back to the behaviour above with the lag etc.

I'm sure it was working a couple of weeks ago when I was using it but something has obviously changed. There was the big windows update and I did start using DPG instead of DPI a while ago, so it could be one of those changes but I am not so sure it's that.

Anyway, any other ideas?



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

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

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


rob
Advanced Member

Posts: 197
Joined: 11/29/2006

Hi,

 

Can anyone see if this behaviour is replicated if they run similar scripts in visual studio code?

 

Thanks,

Rob



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

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

 09/17/2020 03:31 AM
User is offline View Users Profile Print this message

Author Icon
Mav
Top-Tier Member

Posts: 205
Joined: 10/02/2008

Originally posted by: rob Hi,

 

 

 

Can anyone see if this behaviour is replicated if they run similar scripts in visual studio code?

 

 

 

Thanks,

 

Rob

 

Hi!

 

I'm just setting up a new machine so I gave it a try.

I've installed VSCode (1.49.0 x64) on Win10, created a simple scripting command containing a single SendKeys instruction (with DLG 15.6) and uttered the command while sitting at the beginning of a new file.

The text from SendKeys got written into VSCode immediately and without delay or slowdowns.

Trying to dictate directly into VSCode brought up the dictation window, but after switching this off, I could perform basic dictation into VSCode (without full text control, of course).

 

Because I wanted to test with the original command, I copied the code over into the MyCommands editor, but now am unable to save the command because the editor claims that there are syntax errors.

The fact that this $#!tty editor doesn't even tell which line the alleged syntax error is especially helpful for finding it.

This new scripting environment is really a PITA.

mav

 09/17/2020 03:41 AM
User is offline View Users Profile Print this message

Author Icon
Mav
Top-Tier Member

Posts: 205
Joined: 10/02/2008

Another step forward:

Removing the "Option Strict" instruction let me save the command.

But even though the command now worked and produced a snippet of code, I could not witness any delays or slowdowns.

 

Going back to the script I tried putting the "Option Strict" back in but couldn't get the script to save, even after adding the missing declaration of increment.

I can't find any other problems in the script and still do not know why and where there's a syntax error.

 

Nevertheless, it seems as if the delays you experience are not directly VSCode's fault...

 

hth,

mav

 09/16/2020 08:44 PM
User is offline View Users Profile Print this message

Author Icon
kkkwj
Top-Tier Member

Posts: 497
Joined: 11/05/2015

If it was me, I would be testing LCase and UCase in separate test scripts to see if they work with known strings.
Then I would put guards on this code


firstCharacter = Mid (dictate, 1, 1)

firstCharacter = LCase (firstCharacter)

camelVariable = firstCharacter


to avoid taking the LCase of a potentially empty string, null string, or whatever.
These ideas are just shots in the dark; I have no idea if LCase/UCase actually work for DVC commands.
Rob would probably be the best guy to answer the LCase/UCase legality question; he has a deep knowledge of DVC.

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

Win10/x64, AMD Ryzen 7 3700X, 64GB RAM, Dragon 15.3, SP 6 PRO, SpeechStart, Office 365, KB 2017, Dragon Capture, Samson Meteor USB Desk Mic, Klim and JUKSTG earbuds with microphones

 09/17/2020 05:13 AM
User is offline View Users Profile Print this message


rob
Advanced Member

Posts: 197
Joined: 11/29/2006

@Mav thanks for trying that. Only thing is did you notice if when the command has deployed Dragon still recognises what you are saying, but there is a delay in deploying every subsequent command or any dictated text(sometimes the delay only starts after the next command or dictation is deployed), then all the commands and text will deploy all at once after the delay?

The delay only happens after an advanced scripting command has deployed not before or during. For a simple sendkeys command the lag after would be about 3 seconds for the next recognition to deploy or the delay can sometimes happen after the next subsequent command.



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

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



 09/17/2020 05:25 AM
User is offline View Users Profile Print this message

Author Icon
Mav
Top-Tier Member

Posts: 205
Joined: 10/02/2008

I can perform some more tests this afternoon, but I have already called the command several times in succession and also used dictation in between and didn't notice any delays, let alone 3 or more seconds.

 

But I've performed the tests with a pretty pristine system. New Win10, new Dragon installation, no additional tools installed and running...

 

Because I know that disabling and removing of voice commands can fail or hang for an extended period of time, I cannot rule out that the effect stems from KB or SpeechStart which each add their own commands to the running Dragon instance.

 

Can you try if the delays persist if you disable everything else and try just plain vanilla Dragon?

 



 09/17/2020 05:35 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7242
Joined: 03/04/2007

Only thing is did you notice if when the command has deployed Dragon still recognises what you are saying, but there is a delay in deploying every subsequent command or any dictated text(sometimes the delay only starts after the next command or dictation is deployed), then all the commands and text will deploy all at once after the delay?


Rob, keep in mind that, if you rely on dictating into VS Code via "Natural Text" (also referred to as "dumb dictation" by Lunis, for instance), it isn't guaranteed to play by the rules, but rather hit or miss, and it may act up anytime and whichever way. Every time you start dictating, Dragon has to determine the conditions where this happens in and what to do with it. If there is such a pattern, as you describe, there is certainly a reason for it, but no one will ever find out what it is exactly and how to resolve it.

Have you tried mixing running Dragon scripts and straight dictation using a more solid, and non-scripted, approach named DragonCapture in a situation like this? (Which also doesn't involve triggering dictation boxes in any shape or form by the way.)



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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage



 09/17/2020 07:21 AM
User is offline View Users Profile Print this message


rob
Advanced Member

Posts: 197
Joined: 11/29/2006

@Mav you were right that one of the other speech applications might be causing the problem. I ran Dragon on its own which I should have done in the first place and everything worked fine, I then added knowbrainer and everything still worked in visual studio code and then started speechstart+ and then the problems with lag started again in visual studio code.

I'm going to check with the developer that I have the most up-to-date version of speechstart+ and install that if it has been updated and if not try reinstalling the version I have to see if that works.

@R. Wilke I tried DragonCapture a couple of months ago for a couple of days but found the text was not being transferred properly. I cannot remember the exact bug but found that I did not really need it at the time, so did not bother to work out what the problem was. I'm sure I could have worked out if I had got in touch.

If speechstart+ is still not playing well with some programs it would be good to give DragonCapture a try again because it would be good to keep using speechstart+ with all programs as I use a couple features regularly.

Does anyone on this thread run speechstart+ and if so what version are you running, I'm currently using 6.7.00?

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

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

 09/17/2020 07:40 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7242
Joined: 03/04/2007

@R. Wilke I tried DragonCapture a couple of months ago for a couple of days but found the text was not being transferred properly. I cannot remember the exact bug but found that I did not really need it at the time, so did not bother to work out what the problem was. I'm sure I could have worked out if I had got in touch.


Rob, we can always work it out, if we get a chance to. If and when you want to look into it again, just let me know, and I will create a new trial for you, but as this will have to be done manually I would need a heads-up from you.

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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage

 09/17/2020 07:45 AM
User is offline View Users Profile Print this message


rob
Advanced Member

Posts: 197
Joined: 11/29/2006

@R. Wilke yeah will give it another go what is the best way to contact you?
I just messaged you through your site.

 

Thanks,

Rob



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

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



 09/17/2020 08:20 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7242
Joined: 03/04/2007

Done. Make sure to run the latest version, see my signature tag.



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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage



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

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