Dear Lifehacker, I would like to be able to select some text, and then use a shortcut key to search Google for those keywords, regardless of which application is active. Is this possible? Sincerely,
Tired of Copy/Paste
Dear Tired of Copy/Paste,
Using the AutoHotkey scripting language we can throw together a tiny script that assigns the Ctrl+Shift+C shortcut key combination to automate coping the text to the clipboard, and then opens your default web browser with the Google search for the selected text.
You'll want to start by downloading and installing AutoHotkey, and then simply create a new file with the *.ahk extension and paste in the following text, which uses the magic
%clipboard% variable in the Google URL to pass in the search terms.
Once you've saved the file you can run it by double-clicking on the script, which will add a new icon to the system tray. If you want to remove the tray icon and have the script run completely in the background, add the following line to the beginning:
Now that the script is active, you can simply select text in any application, use Ctrl+Shift+C, and you'll instantly see a Google search window for that term. If you want to use a different search engine, you can simply modify the URL line, or add a new hotkey (see the AHK Hotkey documentation).
Love and Geekery,