KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: problem to import vocally KB commands
Topic Summary:
Created On: 05/28/2020 03:41 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 problem to import vocally KB commands   - dicdoc - 05/28/2020 03:41 AM  
 problem to import vocally KB commands   - Lunis Orcutt - 05/28/2020 08:02 PM  
 b.priboblem to import vocally KB commands   - dicdoc - 05/29/2020 05:49 AM  
 re. Problem to import vocally KB commands   - Edgar - 05/29/2020 10:49 AM  
 b.priboblem to import vocally KB commands   - Lunis Orcutt - 05/29/2020 11:18 AM  
 b.priboblem to import vocally KB commands   - dicdoc - 05/29/2020 11:39 AM  
 b.priboblem to import vocally KB commands   - monkey8 - 05/29/2020 03:57 PM  
 b.priboblem to import vocally KB commands   - dicdoc - 05/31/2020 02:38 AM  
Keyword
 05/28/2020 03:41 AM
User is offline View Users Profile Print this message

Author Icon
dicdoc
Top-Tier Member

Posts: 207
Joined: 07/31/2014

I created a macro to import KB commands from my desktop folder, but I can't get to activate the import command.

I defined it as a global command and have to focus on KB first. I use KB shorctuts I see, but i can^t go further than display import command wizard. After that my macro edit's itself...

Any idea how I should do ?

Sub Main
Dim WusrName, WusrComputerName, FileLocation As String
'Heardword "Show", "Sidebar"
Wait .5
SendKeys "%m", 1
Wait.3
SendKeys "i", 1
Wait 1.5
'msgbox ("test 1", vbMsgBoxSetForeground)
'sendkeys "%{tab}", 1
Wait.2
SendKeys "{enter}", 1

Wait .6
'msgbox ("test 2", vbMsgBoxSetForeground)

WusrName =  Environ ( "username" )  ' returns computer user name

FileLocation  = "C:\Users\"& WusrName &  "\OneDrive\Macros KB"

Clipboard FileLocation

Wait .3
SendKeys "^v", 1
Wait .3
SendKeys "{enter}", 1
End Sub


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

Memory: 16GB Microphone Brand and Model: Rec Mic II Operating System: win 10, latest update; Surface Book 2, Processor (CPU) Type & Speed: I7 8650 Soundcard Brand and Model: none Speech Software: Dragon Medical Practice Edition, french version: 4.0 Using KnowBrainer?: No

 05/28/2020 08:02 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 37494
Joined: 10/01/2006

You might try the following as a starter for your command which we wrote in KnowBrainer. If you prefer to deploy this command from within Dragon, change EmulateRecognition "Show Sidebar" to your original HeardWord "Show","Sidebar"

 

Sub Main
EmulateRecognition "Show Sidebar"
SendKeys "%m"
Wait 0.1
SendKeys "i"
Wait 1.5
SendKeys "%b"
Wait 1
SendKeys "%UserProfile%\Desktop\MyKBCommands.xml{Enter}"
End Sub


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

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

 05/29/2020 05:49 AM
User is offline View Users Profile Print this message

Author Icon
dicdoc
Top-Tier Member

Posts: 207
Joined: 07/31/2014

I'm  still stucked to Import Command Wizard dialog. Focus is on "Browse Commands File To Import" button, but sendkeye "%b" or sendkeys "{enter}" does not activate this button



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

Memory: 16GB Microphone Brand and Model: Rec Mic II Operating System: win 10, latest update; Surface Book 2, Processor (CPU) Type & Speed: I7 8650 Soundcard Brand and Model: none Speech Software: Dragon Medical Practice Edition, french version: 4.0 Using KnowBrainer?: No

 05/29/2020 10:49 AM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 789
Joined: 04/03/2009

I tried Lunis’ KnowBrainer script but had the exact same problem. Issuing the script’s statements verbally one by one works just fine so the concept is good. I tried adjusting the Wait 1.5 all the way up to 5 (thinking maybe the dialog is not ready soon enough) but that did not help. Accidentally, I issued the command twice in rapid succession - surprisingly, the first instance failed to open the file dialog but the second one did open the file dialog (but complained that the analyzer was already open).

I suspect this might be made to work using an outside scripting engine (AutoIT, AutoHotKey) or by using SetMousePosition followed by a ButtonClick to physically activate the button.

I can see it's a timing issue because when I test with this reply open the folder location gets stuffed into the message title of this reply long before the dialog actually opens.



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

-Edgar
DPI 15.3, 64-bit Windows 10 Pro, OpenOffice & Word 365, Norton Security, Shure X2U XLR to USB mic adapter with Audio Technica DB135 vocal mic, Asus X299-Deluxe Prime, Intel Core i9-7940X (14 core, 4.3 GHz overclocked to 4.9 GHz), G.SKILL TridentZ Series 64GB (4 x 16GB) DDR4 3333 (PC4 26600) F4-3333C16Q-64GTZ, NVIDIA GIGABYTE GeForce GTX 1060 GV-N1060G1 GAMING-6GD REV 2.0 6GB graphics card

 05/29/2020 11:18 AM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 37494
Joined: 10/01/2006

You might want to temporarily use the manual approach because the next KnowBrainer release is not that far off and all of this will be changed. It should be much easier, in the next release, to organize, export and import your personal commands



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

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

 05/29/2020 11:39 AM
User is offline View Users Profile Print this message

Author Icon
dicdoc
Top-Tier Member

Posts: 207
Joined: 07/31/2014

I prefer a vocal approach : a second KB command to finish the job :-)

 

1st macro enlarges KB in order to compare better the imported macros :

===

Sub Main
Dim WusrName, WusrComputerName, FileLocation As String
HeardWord "Show", "Sidebar"
Wait.3
HeardWord "EXPAND", "Sidebar"
Wait .1
SendKeys "%m", 1
Wait .1
SendKeys "i", 1
Wait 1.5
Wait .3
SendKeys "%b", 1
Wait.3
SendKeys "{enter}", 1


'WusrName =  Environ ( "username" )  ' returns computer user name
'
'FileLocation  = "C:\Users\"& WusrName &  "\OneDrive \Macros KB"
'
'Clipboard FileLocation


End Sub

 

 

======

2n macro finishes the job with a windows siez similar to kB enlarged to see better macros

 

===

Sub Main
Dim WusrName, WusrComputerName, FileLocation As String
WusrComputerName =  Environ ( "COMPUTERNAME" )  ' returns computer name

If WusrComputerName = "1" Then MoveWindow 1, 1, 1, 1902, 2100
If WusrComputerName = "2" Then MoveWindow 1, 1, 1, 1100, 900
If WusrComputerName = "3" Then MoveWindow 1, 1, 1, 2600, 2100
WusrName =  Environ ( "username" )  ' returns computer user name

FileLocation  = "C:\Users\"& WusrName &  "\OneDrive\Macros KB"

Clipboard FileLocation



Wait.3
SendKeys "{enter}", 1
Wait .3
SendKeys "^v", 1
Wait .3
SendKeys "{enter}", 1
End Sub

 



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

Memory: 16GB Microphone Brand and Model: Rec Mic II Operating System: win 10, latest update; Surface Book 2, Processor (CPU) Type & Speed: I7 8650 Soundcard Brand and Model: none Speech Software: Dragon Medical Practice Edition, french version: 4.0 Using KnowBrainer?: No

 05/29/2020 03:57 PM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 3531
Joined: 01/14/2008

The problem you are seeing is effectively a bug. It happens when you're running scripts in parallel with the UI (manipulating the KB UI with a KB script). This form of execution is properly called coroutining and there is a flaw in its implementation which is my fault. It will be fixed in the next release. It's a case of one line of the script waiting for another and no matter how long you set the wait it will never happen. Apologies.



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

 05/31/2020 02:38 AM
User is offline View Users Profile Print this message

Author Icon
dicdoc
Top-Tier Member

Posts: 207
Joined: 07/31/2014

Thanks for explaining and for future debugging :-)



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

Memory: 16GB Microphone Brand and Model: Rec Mic II Operating System: win 10, latest update; Surface Book 2, Processor (CPU) Type & Speed: I7 8650 Soundcard Brand and Model: none Speech Software: Dragon Medical Practice Edition, french version: 4.0 Using KnowBrainer?: No

Statistics
31613 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 0 users logged in.
The most users ever online was 3936 on 09/08/2015 at 11:44 AM.
There are currently 436 guests browsing this forum, which makes a total of 436 users using this forum.

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