Clipboard Web Search Macro


Using a shortcut like [ Ctrl+Alt+G ] allows you to quickly search the web for the text currently on the clipboard. This idea is based on the old utilities for Internet Explorer.

Download the .vbs file:

or Copy code:

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'in_fo[AT]winutilis[DOT]net Dim html, strClp, objShell, strTemp Set html = CreateObject("htmlfile") strClp = html.ParentWindow.ClipboardData.GetData("text") If( strClp <> "" ) Then strTemp = URLEncode(strClp) Set objShell = WScript.CreateObject("WScript.Shell") 'NOTE: The search query might change from time to time. Keep an eye
' and update it when necessary. Some characters need to be escaped like the & needs to be ^& 'normal google search 'objShell.Run "cmd /c start^&ie=UTF-8^&oe=UTF-8^&q=""" &strTemp &"""", 2, false 'experimental google search objShell.Run "cmd /c start^&esrch=BetaShortcuts^&q=""" &strTemp &"""", 2, false Set objShell = Nothing End If Function URLEncode(s1) l = Len(s1) For i = 1 To l s = s & "%" & Right("0" & Hex(Asc(Mid(s1, i, 1))), 2) Next URLEncode = s End Function Set html = nothing WScript.Quit(0) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


Configure it like this: 1. Save the code in a text file and give it a name like clpbs.vbs 2. Create a shortcut to the file clpbs.vbs under Start 3. Give it a "Shortcut key" in Properties like: CTRL + ALT + S 4. Done! Snapshot: Shortcut configuration Use it like this: 1. Select a text 2. Press Ctrl + C 3. Press CTRL + ALT + S 4. Done!
© 2006 Javier Hernandez. All rights reserved. Terms of Use