Hi everyone
Use Custom buttons addon for firefox to trigger the actions in VoxCommando.
Requirements.1. VoxCommando.
http://voxcommando.com/2. Mozilla Firefox. Normal version
http://www.mozilla.org/en-US/firefox/new/ or
Mozilla Firefox. Portable version
http://portableapps.com/apps/internet/firefox_portable 3. Custom Buttons Addon for Firefox.
https://addons.mozilla.org/en-US/firefox/addon/custom-buttons/Instructions.
01. Download and install Mozilla Firefox if you dont have it.
02. Download and install Custom Buttons Addon for Firefox.
03. Click on the firefox tab and select options, Add-on Bar a new tool bar will be added to the bottom of firefox.
04. Right click on the toolbar select Add new button
05. Copy and Paste the code below the Tasmanian Devil into the buttons code section and Click Ok.
/*CODE*/
var file = Components.classes["@mozilla.org/file/directory_service;1"].
getService(Components.interfaces.nsIProperties).
get("ProfD", Components.interfaces.nsIFile); // Profile Directory
file.append("custombuttons"); // Custom Buttons Directory
file.append("sendkeys.vbs"); // VBScript File
var fos = Components.classes["@mozilla.org/network/file-output-stream;1"].
createInstance(Components.interfaces.nsIFileOutputStream);
fos.init(file, 0x02|0x08|0x20, parseInt("666", 8), 0);
// 0x02|0x08|0x20 write, create, truncate
// 0666 read and write permission for owner, group, others
var data = "Option Explicit\n" +
"Dim WshShell\n" +
'Set WshShell = CreateObject("WScript.Shell")\n' +
'WshShell.SendKeys"^+s"\n' +
"Set WshShell = Nothing"; // VBScript Script
fos.write(data, data.length);
fos.close();
var localFile = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile);
localFile.initWithFile(file);
localFile.launch();
A message box will appear like below The button was successfully created. You can add it to any toolbar via "View -> Toolbars -> Customize
"
06. Click Ok
07. Right click on the toolbar again and select Customise
08. A box will appear like below, scroll down until you see the new button and drag it to the Add-on bar.
09. Click Done
10. Congratulations you have successfully created a button.
the custom button example i have provided uses a vbscript SendKeys method to send keystrokes to applications
the keys used are ctrl + shift + s (^+s) and can be seen in the following line
'WshShell.SendKeys"
^+s"\n' +
the above line can be edited to suit your own needs.
11. In order to do something useful we will need to enable the keyboard Hook plugin in VC, so click on Options, then open options, click on the plugins tab, and tick the Hook plugin, then save and close. You may be prompted to do a full restart of VC, if not do it anyway.
12. Next step, from the main screen of VC click on the Plugins tab, Underneath active plugins
you should see Hook, now double click Hook.
You will be presented with a new window called Plugin: Hook, tick log keys, now click on the custom button that you have created, the ctrl + shift + s key will appear as LControlKey+LShiftKey+S, Click on it and it will become highlighted then click on the >> button, this will copy the LControlKey+LShiftKey+S into the specific keys section like below.
13. Click on Save All
14. Once again Click on the Custom button in firefox, now take a look at the Voxcommando History tab you will see the Keystroke like below
15. Now open up the Command editor and then drag and drop the Hook event into an action of your choosing, like below.
16. Save and then close the command editor and restart Voxcommando.
17. Now click on the custom button in firefox once again, if all went well the vc action will be triggered.
Information on the Hook Plugin and Text to Speech is available here
http://voxcommando.com/forum/index.php?topic=901.0Information on Sendkeys is available from here
http://msdn.microsoft.com/en-us/library/8c6yea83%28v=vs.84%29.aspxby using the Hook Plugin we are able to trigger any action in Voxcommando
e.g i use a custom button to trigger the tts engine to speak highlighted text, i have other buttons for home automation etc.
Custom Buttons forum
http://custombuttons.sourceforge.net/forum/If you encounter any problems
with this tutorial, please let me know.
Good luck.