KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: KnowBrainer Scripting
Topic Summary: Moving the Pointer to a Specific Place in a GUI Dialog
Created On: 04/23/2012 06:34 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 KnowBrainer Scripting   - SteveB - 04/23/2012 06:34 PM  
 KnowBrainer Scripting   - Lunis Orcutt - 04/23/2012 08:37 PM  
 KnowBrainer Scripting   - monkey8 - 04/24/2012 11:41 AM  
 KnowBrainer Scripting   - SteveB - 04/24/2012 02:04 PM  
 KnowBrainer Scripting   - monkey8 - 04/24/2012 02:11 PM  
 KnowBrainer Scripting   - Lunis Orcutt - 04/24/2012 07:04 PM  
 KnowBrainer Scripting   - SteveB - 04/27/2012 01:15 PM  
 KnowBrainer Scripting   - monkey8 - 04/27/2012 01:29 PM  
 KnowBrainer Scripting   - SteveB - 04/25/2012 01:21 PM  
 KnowBrainer Scripting   - Lunis Orcutt - 04/25/2012 06:01 PM  
 KnowBrainer Scripting   - SteveB - 04/25/2012 07:22 PM  
 KnowBrainer Scripting   - Lunis Orcutt - 04/25/2012 09:42 PM  
 KnowBrainer Scripting   - SteveB - 04/26/2012 10:11 AM  
 KnowBrainer Scripting   - monkey8 - 04/26/2012 01:06 PM  
 KnowBrainer Scripting   - Lunis Orcutt - 04/26/2012 07:11 PM  
Keyword
 04/23/2012 06:34 PM
User is offline View Users Profile Print this message


SteveB
Power Member

Posts: 44
Joined: 12/12/2006

 Because of a problem in Windows 7 (not present in Windows XP) I frequently lose sound output from my Plantronics CS50 USB headset and with a similar Jabra headset.

I have found that by disabling and immediately re-enabling the speaker portion of the headset by the following procedure, normal function can be restored.


Open the "Sounds" GUI dialog (found in the Windows 7 Control Panel.)  Insofar as I know this dialog has no keyboard (only a mouse) interface.  I can use a voice command to start the dialog which starts with the tab of interest ("Playback" selected.  This displays a column of icons each representing one of the sound output devices on the system.

To accomplish my task: I must open the sounds dialog, position the pointer atop the CS50 icon, right-click on it which presents a context list, move the pointer to the "disable" item and left click it, reposition the pointer to the same icon, right-click it and left click on the "enable" item in the context list and, finally, close the dialog.

Most of the above can be easily accomplished with voice commands (e.g. "mouse right-click",  "click disable" and, "click enable"– that is, all but positioning the pointer atop the CS 50 icon.

Lunis suggests that it is possible to write a KnowBrainer script that accomplishes the whole task but prefers that I asked for help here in this forum.

Please note that because I am seriously visually impaired (legally blind) the above is quite difficult for me to accomplish especially because I cannot cope with verbal basic.

I would appreciate any help that can be provided to me.

Thanks,

Steve

 



-------------------------
Steve
 04/23/2012 08:37 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 22587
Joined: 10/01/2006

The only tech-support caveat we have, with end users who receive a complimentary copy of KnowBrainer 2011, is that they obtain support through this forum or via our Tech Support Options because we are literally giving away KnowBrainer. We can only offer free e-mail, virtual on-site and telephone support for software and hardware that we sell.

If you were using DNS Pro, this would be a snap because you could use Advanced Scripting command with a
Shell "control mmsys.cpl" script which could directly open the Sound Playback devices and would deploy about 3 times faster. Unfortunately, KnowBrainer does not support Shell controls but there is another way to skin that cat.

1. Right click on your Windows desktop and select Personalize
2. Click Change Desktop Icons on the upper left side
3. Place a checkmark in Control Panel, and click OK to make the Control Panel viewable from your desktop. This will make the rest of this command considerably easier to deploy.

Create a new global KnowBrainer command, call it anything you want and copy the following script into your command. Note that you will have to close and re-launch KnowBrainer before the change will take effect:

AppBringUp "mmsys.cpl" 
Wait 3000
SendSystemKeys "{End}{Alt+s}"
Wait 1000
SendSystemKeys "{Home}{Alt+s}"
Wait 500
SendKeys "{Enter}"
Wait 1000
SendSystemKeys "{Alt+F4}"


The previous command should open the Control Panel, wait 2 seconds for the Control Panel to open, press
s to highlight the Sounds icon, press {Enter} to open the sounds icon, move the focus to the last sound device, press {Alt+s} to change it to the default, press {Home} to move the focus to the 1st sound device, press {Alt+s} to change it to the new default setting, press {Enter} to make everything permanent, close the Sound utility and press {Alt+F4} to close the Control Panel. The following is a picture of what your command should look like but note that you may have make some edits to fit your circumstance because we have no idea where your CS50-USB soundcard is positioned in the group. You might also have to substitute {Down}, {Down 2}, {Up}, {Up 3} etc. for {Home} or {End}. Hopefully this sample command will include enough information for you to edit it to fit your needs.

                 


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


Click KB 2012 REV D to Download a 30 Day Evaluation of KnowBrainer 2012 


 


 


 

 04/24/2012 11:41 AM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 1987
Joined: 01/14/2008

Quote:
If you were using DNS Pro, this would be a snap because you could use Advanced Scripting command with a Shell "control mmsys.cpl" script which could directly open the Sound Playback devices and would deploy about 3 times faster. Unfortunately, KnowBrainer does not support Shell controls but there is another way to skin that cat.

AppBringUp"mmsys.cpl"

Windows 7 makes it easy.

Lindsay



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


www.pcbyvoice.com
www.pcbyvoice.co.uk

 04/24/2012 02:04 PM
User is offline View Users Profile Print this message


SteveB
Power Member

Posts: 44
Joined: 12/12/2006

Thank you,

I tried AppBringUp"mmsys.cpl" in a CMD.EXE window – it didn't work


How and in what context is it used?



-------------------------
Steve
 04/24/2012 02:11 PM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 1987
Joined: 01/14/2008

Steve you need to use it in a KnowBrainer script.  AppBringUp is a function/methods that will work with DVC scripting and advanced scripting, KnowBrainer scripting is almost identical to DVC.

Lindsay

To put it another way, Lunis has shown you a script above that will do what you require. I didn't realise initially it takes you the whole way through your scenario. If you replace the first three lines with the AppBringUp"mmsys.cpl" it should operate quicker and more reliably. I can try later but I'm sure Lunis will confirm before then. Sorry there is a big football match in you about to start and my kids are both supporting one of the teams :-)



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


www.pcbyvoice.com
www.pcbyvoice.co.uk

 04/24/2012 07:04 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 22587
Joined: 10/01/2006

Thank you Lindsay. We have just been put into the position of learning something about our own application. Lindsay is correct and we have changed our command to reflect those changes. You can completely ignore having to put a shortcut to the Control Panel on your desktop because you will no longer need that part in your command.

Thanks to Lindsay, the next version of KnowBrainer will include the ability to open most Control Panel utilities.


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


Click KB 2012 REV D to Download a 30 Day Evaluation of KnowBrainer 2012 


 


 


 

 04/27/2012 01:15 PM
User is offline View Users Profile Print this message


SteveB
Power Member

Posts: 44
Joined: 12/12/2006

Hallelujah!

Lindsay, I cannot thank you enough – it works like a charm!

The time and frustration you have saved me is truly beyond belief.  I have been fighting this problem ever since I installed Windows 7 – it never occurred with XP.

The "Shift+F10" to bring up the context menu was a total surprise to me.  That, and other accelerator keys must be documented somewhere but, I have no idea where.

Again thank you for materially improving my life,




-------------------------
Steve
 04/27/2012 01:29 PM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 1987
Joined: 01/14/2008

Steve it's my pleasure, if you get the chance then try to look through all the other various KnowBrainer commands as I'm sure you will find lots of them very useful as well as giving you ideas to create your own commands. None of it would be possible if Lunis was not supplying his software to the disabled free of charge.

Lindsay

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


www.pcbyvoice.com
www.pcbyvoice.co.uk

 04/25/2012 01:21 PM
User is offline View Users Profile Print this message


SteveB
Power Member

Posts: 44
Joined: 12/12/2006

I am sorry to report that what you suggest does not work at all!

The following sequence of voice commands does do what I want done:

"Start sounds"
NOTE:  "sounds" is the name of a shortcut on my Desktop to the control panel's Sound dialog.
"mouse window 2 8 5"
"mouse right click"
"click disable"
"mouse window 2 8 5"
"mouse right click"
"click enable"
"close window"

Beside the substitution of "AppBringUp"mmsys.cpl" for the "Start sounds" voice command is there any way to automate the remaining voice commands?

Thanks,



-------------------------
Steve
 04/25/2012 06:01 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 22587
Joined: 10/01/2006

Because we don't have a picture of what you're trying to do, we can't give you a precise macro but mouse clicks are not required or necessary. You should be able to edit the following code to create a specific KnowBrainer command to fit your needs. In other words you can do everything with a single command. Your other option would be to contact us for Virtual On-Site Support (615) 884-4558 x2 but note that we charge for that service. We used to use a similar command when 1 of our computers insisted on changing the speed of our mouse to molasses every time we rebooted. It was a pain in the butt to manually perform 7 steps which included opening the Control Panel, locating the Mouse control, double-clicking the Mouse control, clicking the appropriate tab, manually maximizing the slider speed control, clicking the OK button and closing the Control Panel. A variation of the following code should work in KnowBrainer. Obviously, you may need to edit some of the controls as previously explained. 

AppBringUp "mmsys.cpl"
Wait 2000
SendSystemKeys "{End}{Alt+s}"
Wait 1000
SendSystemKeys "{Home}{Alt+s}"
Wait 500
SendSystemKeys "{Enter}"


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


Click KB 2012 REV D to Download a 30 Day Evaluation of KnowBrainer 2012 


 


 


 

 04/25/2012 07:22 PM
User is offline View Users Profile Print this message


SteveB
Power Member

Posts: 44
Joined: 12/12/2006

I am sorry to report that what you suggest still does not work at all!

In lieu of a picture: voice commands which are underlined are followed by lines, marked with an * describing what happens on screen.

Start sounds
*starts the sound dialog – with the pointer placed randomly on the screen i.e. the pointer does not follow the focus.

mouse window 2 8 5
*places the pointer directly over the desired speaker device.

mouse right click

*brings up the context menu for the device.

click disable
*disables the device while leaving the pointer where the disable context item was and is invariably "outside" the boundary of the device's icon.

mouse window 2 8 5
*repositions the pointer over the desired device

mouse right click
*brings up the context menu once again.

click enable
*enables the device.

close window
*closes the sound dialog.

Since this invariably works in all circumstances and the use of "end", "home"and, "alt+S" keys do nothing I would really like to automate the above process if it is possible and, would appreciate any help to accomplish that end.

Thanks,

 

 

Thanks,



-------------------------
Steve
 04/25/2012 09:42 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 22587
Joined: 10/01/2006

As we stated previously, this can all be handled in a single significantly faster command without the use of any mouse coordinates. However, without a JPEG of your sound configuration, we cannot complete the command. In other words we have to see what we're working on and that is why we said that you would have to edit our command if you couldn't supply us with a picture of what you need. We appear to be at a roadblock.

We will be happy to complete this command for you virtually but at this point we can only point you to our
Tech Support Options.


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


Click KB 2012 REV D to Download a 30 Day Evaluation of KnowBrainer 2012 


 


 


 

 04/26/2012 10:11 AM
User is offline View Users Profile Print this message


SteveB
Power Member

Posts: 44
Joined: 12/12/2006

Lunis, It took me a while but I just figured out how to include this picture – please forgive my naïveté.

Please see the attachment (and not my very red face.)

Sounds Picture.doc
Sounds Picture.doc  (15 KB)



-------------------------
Steve
 04/26/2012 01:06 PM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 1987
Joined: 01/14/2008

Try a KnowBrainer script with the following content:

 AppBringUp"mmsys.cpl"
 Wait 2000
 SendSystemKeys"{Down}{Shift+F10}{Down 3}{Enter}"
 Wait 500
 SendSystemKeys"{Down}{Shift+F10}{Down 2}{Enter}"
 Wait 200
 SendSystemKeys"{Alt+F4}"

Lindsay

Incidentally for the above script to work correctly you need to have a check mark on the context menu item "show disabled devices". You must already have this otherwise your own procedure above would not work.

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


www.pcbyvoice.com
www.pcbyvoice.co.uk

 04/26/2012 07:11 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 22587
Joined: 10/01/2006

Lindsay, we were thinking of a different approach but your concept looks better. Nice out-of-the-box thinking.

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


Click KB 2012 REV D to Download a 30 Day Evaluation of KnowBrainer 2012 


 


 


 

KnowBrainer Speech Recognition » NaturallySpeaking Speech Recognition » KnowBrainer Scripting

Statistics
27361 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 3 users logged in.
The most users ever online was 2028 on 04/05/2013 at 07:36 PM.
There are currently 174 guests browsing this forum, which makes a total of 177 users using this forum.

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