KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Advanced Scripting Running Slow in Dragon Dictation Box
Topic Summary:
Created On: 06/01/2020 10:36 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Advanced Scripting Running Slow in Dragon Dictation Box   - BrittinCavanagh - 06/01/2020 10:36 PM  
 Advanced Scripting Running Slow in Dragon Dictation Box   - Lunis Orcutt - 06/02/2020 12:52 AM  
 Advanced Scripting Running Slow in Dragon Dictation Box   - BrittinCavanagh - 06/03/2020 02:15 PM  
 Advanced Scripting Running Slow in Dragon Dictation Box   - Alan Cantor - 06/03/2020 02:37 PM  
 Advanced Scripting Running Slow in Dragon Dictation Box   - Matt_Chambers - 06/03/2020 04:05 PM  
 Advanced Scripting Running Slow in Dragon Dictation Box   - Lunis Orcutt - 06/03/2020 05:26 PM  
 Advanced Scripting Running Slow in Dragon Dictation Box   - Matt_Chambers - 06/03/2020 05:38 PM  
 Advanced Scripting Running Slow in Dragon Dictation Box   - Matt_Chambers - 09/11/2020 12:35 PM  
 Advanced Scripting Running Slow in Dragon Dictation Box   - Matt_Chambers - 09/11/2020 05:21 PM  
 Advanced Scripting Running Slow in Dragon Dictation Box   - dilligence - 09/11/2020 10:32 PM  
Keyword
 06/01/2020 10:36 PM
User is offline View Users Profile Print this message

Author Icon
BrittinCavanagh
New Member

Posts: 2
Joined: 05/04/2020

We use an in-house Laboratory Information System which is not supported by Dragon so we have to use the Dragon dictation box to input data into the system.  However, advanced scripting commands which run swiftly and smoothly in word, will run very slowly in the Dragon dictation box.  I have used SendKeys, SendDragonKeys, and SendSystemKeys, all three of which are slow.  SendDragonKeys works the best for us.  What would be slowing the commands in the dictation window compared to in word?  A simple sample dictation is below.

Sub Main

 

                SendDragonKeys "The specimen labelled '" +ListVar2 + "' is a tan tissue fragment {(}" +ListVar1+ " mm{)} that is submitted entirely in one cassette.  AI"

End Sub

 06/02/2020 12:52 AM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 38137
Joined: 10/01/2006

                    Welcome (See Mission Statement)

 

There is a much better way which may not require personal commands. Unfortunately, the Dragon SAX scripting engine is a circa 2006 scripting dog that Nuance won't be replacing, with WinWrap Basic (which we use in KnowBrainer), until Dragon 16 is released. Funny how we know that stuff. It's almost like we have friends in low places  If you don't require Dictation Box special formatting, you can substitute with Notepad. Everything flies in Notepad; even faster than Microsoft Word or DragonPad. If you're using KnowBrainer 2017, you can say something like Notepad <where are my pants> to simultaneously open Notepad and type “Where are my pants” (notice how even the 1st word is properly capitalized). When you finish dictating, say Transfer to cut your text to the clipboard, close Notepad and paste your dictation into the target application. While this was a good workaround last year, time goes on and this is now yesterday's news. Moving on…


You don't need the Dictation Box, Notepad or anything else because you can now directly dictate anytime, anywhere, any place. Notice we said ANY; not most. Click the Trial Downloads link in our signature tag where you will find a 30 day trial of DragonCapture and KnowBrainer 2017, plus a few other goodies. DragonCapture will allow you to dictate everywhere without trigger commands. It'll even nail proper capitalization and spacing. You may think you're dictating into Microsoft Word, until you have to manually select a word and attempt to dictate your correction, which will come up with a capital letter and improper spacing. DragonCapture is great for raw dictation but not correcting. This is where the KnowBrainer 2017 Type <dictation> command comes into play. When you highlight a word that needs to be corrected with proper capitalization, spacing, the 
Type <dictation> AI command handles this and even moves the cursor to the end of the paragraph. KnowBrainer additionally includes pseudo-Select-&-Say. You don't actually have to use your mouse to select, delete, underline, italicize, cut, copy etc. because you can do this by voice in most applications that follow typical Microsoft rules, like OneNote and PowerPoint. Now… If you can dictate with proper capitalization and spacing, utilize Select-&-Say and correct in a non-Dragon friendly environment, you can retire the Dictation Box.

 

KnowBrainer is chock-full of AI commands like being able to move your cursor to the next field and simultaneously dictate, or the other way around. Even if you're working in a Dragon friendly environment, Dragon can't do things like combining command deployment with dictation. This is no longer your father's Buick. Sorry about the advertising but we hate to see Dragon end-users think they need the to kill their efficiency with the Dictation Box, which is Dragon's way of offering a 2nd class workaround for a fixable problem.



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

Forum Mission Statement
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ext 1

 06/03/2020 02:15 PM
User is offline View Users Profile Print this message

Author Icon
BrittinCavanagh
New Member

Posts: 2
Joined: 05/04/2020

Thank you for the information, I was afraid that was the problem. I work for a large corporation so getting them to purchase additional software is quite tricky especially when we have multiple users. I download the trial for myself and I will look into the notepad workaround. Thank you!
 06/03/2020 02:37 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 3869
Joined: 12/08/2007

There may be options besides using the Dictation Box or Notepad. For example, you may be able to use custom dialog boxes that prompt the user for certain information; use text that the user has selected (manually or by voice) to grab text for processing; or copy text in the clipboard to a variable for analyzing and parsing out.
 06/03/2020 04:05 PM
User is offline View Users Profile Print this message

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 272
Joined: 08/09/2018

I use this version of a dictation box, which, as you can see was created in Advance Scripting by the late Larry Allen of PCspeak.com and Valerie Matthews of Polar Engineering. Maybe it will run faster for you than the regular Dictation Box.

' code courtesy of Polar Engineering; Valerie Matthews of ScanSoft; and Larry Allen of Softnet Systems, Inc.
Option Explicit

Const FONT=12 ' Approximate font size - change as required

Const LOGPIXELSY = 90

Const WM_SETFONT = &H30

Declare Function CreateFontA Lib "gdi32" ( _
ByVal nHeight As Long, _
ByVal nWidth As Long, _
ByVal nEscapement As Long, _
ByVal nOrientation As Long, _
ByVal fnWeight As Long, _
ByVal fdwItalic As Long, _
ByVal fdwUnderline As Long, _
ByVal fdwStrikeOut As Long, _
ByVal fdwCharSet As Long, _
ByVal fdwOutputPrecision As Long, _
ByVal fdwClipPrecision As Long, _
ByVal fdwQuality As Long, _
ByVal fdwPitchAndFamily As Long, _
ByVal lpszFace As String _
) As Long

Declare Function DeleteObject Lib "gdi32" ( _
ByVal hObject As Long _
) As Long

Declare Function GetDeviceCaps Lib "gdi32" ( _
ByVal hDC As Long, _
ByVal nIndex As Long _
) As Long

Declare Function GetDlgItem Lib "user32" ( _
ByVal hDlg As Long, _
ByVal nIDDlgItem As Long _
) As Long

Declare Function GetWindowDC Lib "user32" ( _
ByVal hWnd As Long _
) As Long

Declare Function ReleaseDC Lib "user32" ( _
ByVal hWnd As Long, _
ByVal hDC As Long _
) As Long

Declare Function SendMessageA Lib "user32" ( _
ByVal hWnd As Long, _
ByVal uMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long _
) As Long

Dim hFont As Long
Dim VMenu As IVMenuAuto

Sub Main
Dim hDC As Long
Dim result As Integer
hDC = GetWindowDC(0)
Dim Height As Long

Height = -FONT*GetDeviceCaps(hDC,LOGPIXELSY)/72
ReleaseDC 0,hDC
hFont = CreateFontA(Height,0,0,0,0,0,0,0,0,0,0,0,0,"MS Sans Serif")
Begin Dialog UserDialog 530,385,"Show Box",.DlgFunc ' %GRID:10,7,1,1
TextBox 10,7,500,336,.TextBox1,1
OKButton 60,357,90,21
CancelButton 210,357,90,21
End Dialog
Dim dlg As UserDialog

result = Dialog (dlg)

If result = -1 Then ' If the user clicked OK,
Clipboard dlg.TextBox1 ' copy the text box contents to the clipboard
Wait .2
SendKeys "^v" ' and then paste them to the active application.
End If

DeleteObject hFont

End Sub

Rem See DialogFunc help topic for more information.
Private Function DlgFunc(DlgItem$, Action%, SuppValue&) As Boolean
Select Case Action%
Case 1 ' Dialog box initialization
Dim hWnd As Long
hWnd = GetDlgItem(SuppValue,DlgControlId("TextBox1"))
SendMessageA hWnd,WM_SETFONT,hFont,1
' hWnd = GetDlgItem(SuppValue,DlgControlId("TextBox1"))
' SendMessageA hWnd,WM_SETFONT,hFont,1
'

Case 2 ' Value changing or button pressed


Case 3 ' TextBox or ComboBox text changed
Case 4 ' Focus changed
Case 5 ' Idle
Rem DlgFunc = True ' Continue getting idle actions
DlgFocus("TextBox1")
Case 6 ' Function key
End Select
End Function
 06/03/2020 05:26 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 38137
Joined: 10/01/2006

Matt, have you tried this script? We are asking because we have a slight variation of the same script from about a decade or so ago and can't get either command to save. Interestingly enough, our version of the command, which used to work, was imported from a previous version of Dragon such as 7 or 8.



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

Forum Mission Statement
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ext 1



 06/03/2020 05:38 PM
User is offline View Users Profile Print this message

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 272
Joined: 08/09/2018

Originally posted by: Lunis Orcutt Matt, have you tried this script? We are asking because we have a slight variation of the same script from about a decade or so ago and can't get either command to save. Interestingly enough, our version of the command, which used to work, was imported from a previous version of Dragon such as 7 or 8.

 

Yes, Lunis, I use it pretty regularly.

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

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 272
Joined: 08/09/2018

Originally posted by: Matt_Chambers
Originally posted by: Lunis Orcutt Matt, have you tried this script? We are asking because we have a slight variation of the same script from about a decade or so ago and can't get either command to save. Interestingly enough, our version of the command, which used to work, was imported from a previous version of Dragon such as 7 or 8.  

 

 

 

Yes, Lunis, I use it pretty regularly.

 



Interestingly, this dictation box seems to be broken with DPI 15.6.

 09/11/2020 05:21 PM
User is offline View Users Profile Print this message

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 272
Joined: 08/09/2018

Originally posted by: Lunis Orcutt Matt, have you tried this script? We are asking because we have a slight variation of the same script from about a decade or so ago and can't get either command to save. Interestingly enough, our version of the command, which used to work, was imported from a previous version of Dragon such as 7 or 8.

 

Lunis,

I found that if I commented out line 58 (Dim VMenu As IVMenuAuto), it works, but the box doesn't always reliably come out on top.

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

Author Icon
dilligence
Top-Tier Member

Posts: 1158
Joined: 08/16/2010

BrittinCavanagh,

 

Running SendKeys, SendSystemKeys (particularly Open Ended commands) in the Dragon Dictation box, Dragon Command Browser and some other applications can cause significant delays and "stuttering" on some systems. On the other hand in Notepad, Word and most other applications there is no delay at all. This has to do with the type of (rich)text control being used. At least in DPI 15.

 

In DPG 15.5 and up (and probably also with the most recent DPI 15.6 version) this problem appears to have vanished. Personally I find this one of the biggest upsides to these versions because I use a lot of SendKeys (DVC) commands.

 

I think it has to do with the WinWrap scripting engine used in these new versions which is also used in KB 2017 (KB SendKeys commands won't cause any of the above delays and work very smoothly).



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

www.speechproductivity.eu 


Fast Add-ons for Dragon Professional - Easy Guide to Dragon Scripting

Statistics
31833 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 423 guests browsing this forum, which makes a total of 423 users using this forum.

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