February 04, 2014

ThinkVantage Custom Scripts

ThinkVantage Button (X1 Carbon)
If you own a Lenovo laptop, chances are that you have a "ThinkVantage" button on your keyboard. It's that
thin rectangle button on the top left of your keyboard (actual size and location depends on your laptop model).

You first have to do a registry edit to change the button from the default Lenovo software. Please refer to this link for instructions. You'd have to change the registry entry to point to the following BAT file I wrote.

Here are two files that I wrote to turn that button into a custom script for running a Google voice search. The actual usability of the script depends on your laptop and how quickly you can open a browser. I purposely put a long sleep timer on the VBS script to account for slower startup times on your browser. If you find that you are opening a new browser and waiting too long before the voice search starts, then feel free to lower the 5000 to a smaller number.

The script.bat file which points to the VBS file below. For some reason you can't just directly point to a VBS file in the registry so I had to work around it by using this BAT file.
@echo off
wscript "C:\script.vbs"
The script.vbs file. Opens a new browser, navigates to Google, pauses for a bit, then presses Ctrl+Shift+. to activate the voice search command.
Dim iURL
Dim objShell
iURL = "www.google.com"
set objShell = CreateObject("WScript.Shell")
WScript.Sleep 5000
objShell.AppActivate "Chrome"
objShell.SendKeys "^+."

On a side note, what's the fastest way you can think of to search Google?

No comments:

Post a Comment