KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Quickly change user profile between two languages
Topic Summary: by voice command
Created On: 09/19/2019 04:31 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 Quickly change user profile between two languages   - GregBau - 09/19/2019 04:31 AM  
 Quickly change user profile between two languages   - R. Wilke - 09/19/2019 03:07 PM  
 Quickly change user profile between two languages   - GregBau - 09/20/2019 03:47 AM  
 Quickly change user profile between two languages   - Lunis Orcutt - 09/20/2019 04:37 PM  
 Quickly change user profile between two languages   - Inga - 04/26/2022 09:30 PM  
 Quickly change user profile between two languages   - R. Wilke - 04/27/2022 03:47 AM  
 Quickly change user profile between two languages   - Inga - 05/01/2022 06:14 PM  
 Quickly change user profile between two languages   - Inga - 05/01/2022 06:25 PM  
 Quickly change user profile between two languages   - R. Wilke - 05/01/2022 06:56 PM  
 Quickly change user profile between two languages   - R. Wilke - 09/21/2019 02:25 AM  
 Quickly change user profile between two languages   - GregBau - 09/21/2019 06:17 AM  
 Quickly change user profile between two languages   - R. Wilke - 09/21/2019 06:46 AM  
Keyword
 09/19/2019 04:31 AM
User is offline View Users Profile Print this message

Author Icon
GregBau
Power Member

Posts: 79
Joined: 08/31/2014

Hi forum,

 

there is this global command "[open] [the] recent user profile" which is useful to switch back to the previous language, particularly when using exactly two languages.

 

For some reason and when I'm in a hurry, I can never remember the exact wording of that command, all the more since it is of course different in my two languages.

 

Is there a way to assign a custom command wording to that command, and preferably the same wording in both languages I use – for example a custom fantasy word that Dragon would recognize in both languages?

 

What's more, can I create a single command that does the following two things:

 

 

  • - "stop dictation mode" (i.e. "go back to Dictation & Command mode")
  • - "open the recent user profile" (i.e. switch languages)

 

 

Thanks for any ideas how to accomplish this.



 09/19/2019 03:07 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7840
Joined: 03/04/2007

Here is an Advanced Script accomplishing this, assuming that you have a UK English user profile, and a German user profile, and you want to switch back and forth between them:

Dim eng As New DgnEngineControl
If eng.SpeakerLanguage(eng.Speaker) = dgnlangUKEnglish Then
HeardWord "normal", "mode", "on"
HeardWord "recent", "user", "profile"
ElseIf eng.SpeakerLanguage(eng.Speaker) = dgnlangGerman Then
HeardWord "Standardmodus", "starten"
HeardWord "letztes", "Benutzerprofil"
Else
MsgBox "The current language is not supported in this script"
End If

I have called the script "switcher" both in English and in German, and tested it in both languages.



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



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

DragonCapture KB Download (Latest)
DragonCapture Homepage

 09/20/2019 03:47 AM
User is offline View Users Profile Print this message

Author Icon
GregBau
Power Member

Posts: 79
Joined: 08/31/2014

That's awesome Ruediger. This worked instantly in both languages.

However, it seems that the command is only recognized when I'm not in Dictation Mode. So is there a way to specify that this is a "command" to be recognized also in Dictation Mode, in a similar way the "enable recognition mode switching commands" also work in Dictation Mode? 

On the other hand, if there should be no way to add such "Global²" commands, probably the lines

- HeardWord "normal", "mode", "on"
- HeardWord "Standardmodus", "starten"

could be removed from the script, correct? 

 09/20/2019 04:37 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 39831
Joined: 10/01/2006

The answer is no because the point of Dragon including Dictation Mode is to disable all but Dictation Commands from deploying. An example of a dictation command is new line. You only have very limited vocabulary command options which will not help in your situation. 

 

When Dragon is in Dictation Mode, the only commands you can utilize are switch to normal mode ect... You can optionally create a HeardWord script but you can't use it because you are prevented from deploying commands. This is the entire point of Dictation Mode. Unless you have a compelling reason to limit Dragon to Dictation Mode, we recommend using Normal Mode. Your only other option would be to say switch to command mode or switch to normal mode, deploy your command and then say switch to dictation mode.



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

Change "No" to "Know" w/KnowBrainer 2020
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ex 1



 04/26/2022 09:30 PM
User is offline View Users Profile Print this message

Author Icon
Inga
New Member

Posts: 4
Joined: 04/26/2022

I am new to scripting, could you tell me how to exactly implement this script? I also need to switch between UK/International English and German and vice versa.

 

 thanks a lot!

Inge

 

 

 04/27/2022 03:47 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7840
Joined: 03/04/2007

Originally posted by: Inga

 

I am new to scripting, could you tell me how to exactly implement this script? I also need to switch between UK/International English and German and vice versa.

 

 

 

 thanks a lot!

 

Inge
 

 

 

 

 

 

Hi,

 

Is it Inge or Inga? - Anyway, if you are referring to the script that I posted above, for example, on the Dragon bar in an English user profile, and assuming that the menus are the same in the version that both you and I use (DPG 15.71 as far as I am concerned), go to "Tools - Command Center - Add New Command", which will open the "MyCommands Editor".

 

Enter a "MyCommand Name" of your choice. As pointed out, if you want the script to automate switching back and forth between English and German user profiles, I suggest "switcher" as command name, because it is recognised easily in both languages.

 

Next, go to the drop-down list under "Command Type", and select "Advanced Scripting" from the list. Doing so will populate the editor below, and already paste "Sub Main" and "End Sub" into the box. They are the goalposts where the ball needs to go in, so to speak.

 

Then all you have to do is to copy and paste the lines posted above between the "posts" and save the script.

 

For this particular purpose, you need to repeat the process also for the second language your are using. If it is German, the steps are all the same, and so is the code, since there is no "German" coding for that matter.

 

As far as the code, and if you are new to it, don't bother understanding what it is all about, just run it and be happy with it.

 

Hope this helps.

 

 

 



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



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

DragonCapture KB Download (Latest)
DragonCapture Homepage



 05/01/2022 06:14 PM
User is offline View Users Profile Print this message

Author Icon
Inga
New Member

Posts: 4
Joined: 04/26/2022

 

Hi, it's Inga with an A, but Dragon occasionally mistypes this – I should probably retrain it better to properly spell my name! I shall try implementing the script and will feedback whether it works.   

I faffed around with the command  editor bit, but I must have done something wrong last time. let's see if I'm in luck this time.  Do I need to do anything differently , such as needing to indicate whether I'm using the Austrian, Swiss, or Germany German user profile, given that your script does distinguish between UK and US English?



 05/01/2022 06:25 PM
User is offline View Users Profile Print this message

Author Icon
Inga
New Member

Posts: 4
Joined: 04/26/2022

 

Hi Rüdiger,

 thanks a lot for your reply!

Can you tell me what I'm supposed to put in group, availability, object, and process? And does the way I've put it into the command editor look correct to you? Because at the moment, once I press save, the program tells me to correct syntax errors, but I'm not sure what exactly the syntax error is in the way that I've done it, because I just copied the script you posted above. Maybe I have to select something else in group, availability, object, or process? Currently, this is when using the English user profile, I haven't done it for the German  profile yet, because it didn't let me save this one. any ideas what the issue is? Thanks in advance!

 05/01/2022 06:56 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7840
Joined: 03/04/2007

Hi Inga,

 

To admit, I haven't run the script since I posted it back then, but it should still work "as is". Perhaps you should try deleting anything before "Sub Main", as those parts didn't exist at that time and have become known for causing older scripts to fail if they are around.

 

Alles so ein neumodischer Kram!



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



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

DragonCapture KB Download (Latest)
DragonCapture Homepage

 09/21/2019 02:25 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7840
Joined: 03/04/2007

Sorry, Greg, but I missed the point of commands not being available in dictation mode, and I missed it because I use "normal mode" throughout. As Lunis already pointed out, the only commands available in dictation mode are the switching mode commands, given that the option is activated as per your screenshot. Unfortunately, you can't even force command recognition by pressing and holding the control key, when in dictation mode, also, if my additional testing was correct.

I also don't think that overriding this behaviour is possible somehow.

Therefore, yes, the lines in the script referring to switching the mode are redundant, and you might as well just delete them.



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



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

DragonCapture KB Download (Latest)
DragonCapture Homepage



 09/21/2019 06:17 AM
User is offline View Users Profile Print this message

Author Icon
GregBau
Power Member

Posts: 79
Joined: 08/31/2014

Okay thanks guys. So I suppose there is no way to hack ONE additional command into Dictation Mode?

Alternatively, is there any way to start an Advanced Script command other than by voice, for example by a key combination?

If not, I will probably have to stick with using two voice commands instead of only one, in order to switch between the two languages I use.
 09/21/2019 06:46 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7840
Joined: 03/04/2007

Most likely, there is no such hack, and I wouldn't look for it anyway.

There are always ways to execute an Advanced Script, or execute code represented in the script, via a key combination, however from inside Dragon. To the best of my knowledge, some third-party utilities can do that. If I needed to do this, I would call into the script via a button assigned in the PDCC (the control software to the Philips SpeeckMike that I use), or write a stand-alone C++ executable.

The big question, though, would be whether the HeardWord commands not being recognised in dictation mode can be overriden this way at all. I doubt that it can.



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



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

DragonCapture KB Download (Latest)
DragonCapture Homepage

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

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