[Tips] Launch your browser to search for the text or URL in your clipboard
In this tip, you will make two favorites work together inside a group. When a group of favorites is selected in the menu, its favorites are launched sequentially. In this example, the first favorite will launch you preferred browser and the second one will paste the content of your clipboard to launch a search (with Google or Bing, for example, as configured in your browser). This tip will also show you how to assign a keyboard shortcut to a group.
Note: Since v9.2, QAP allows to put the content of the Clipboard as a parameter for Application favorites using the {Clipboard} placeholder. The example in that page shows how to search for the clipboard using this placeholder. However, the tip in this page has the advantage of allowing to search for text in the Clipboard OR to open the URL in the Clipboard. Also, it shows you how a group and a little macro snippet can increase the possibilities of QAP.
First, create a group. Click Add, select the type Group and give it a name like “Launch Browser and Search”.
Before saving your group, open the Menu Options tab and click the Change button beside the Shortcut zone and assign an hotkey of your choice. In the example below, I chose Shift + Control + G (“G” standing for Google because the end result is a Google search).
Now, click Add to save your group and open it in the Settings window.
Before creating the next favorite, make sure your preferred browser is running. This will facilitate the creation of the favorite for this application. In this example, I will use Firefox but you could also use Chrome or Internet Explorer. See the note at the end about browsers.
In the Launch Browser and Search group, add an Application favorite. In the Add Favorite dialog box, see the the drop down list at the bottom of the Basic Settings tab. It contains a list of all applications running on your system. Select your browser. If you prefer, you can use the Browse button to select the executable file for your browser. Click Add.
Now, add another favorite to the group. Make sure this favorite comes second in the group. Select the type Snippet and name it “Paste Clipboard”. In the Advanced Settings tab, choose the Macro mode. Back to the Basic Settings tab, enter the following codes in the Content text box: “{&2000}^v{Enter}”. Click Add to save the favorite.
What this macro snippet is doing is quite straightforward:
- it makes a pause of 2 seconds (2000 milliseconds); this delay is required to give your browser the time required to be fully launched; later, you could shorten this delay to 1000 or 500 millisecond if everything goes well;
- it sends the key Control + V to the current window (the browser in this case); this will paste the content of your clipboard to the address bar of your browser;
- and it sends the Enter key to the browser, launching a Google search.
Your group is ready. Back in the Settings window, click Save & Close to save your changes and refresh the QAP menu.
Now, copy some text to your clipboard, for example, “Quick Access Popup”, and select the group Launch Browser and Search in your menu or, more conveniently, hit the shortcut you choose for the group (Shift + Control + G, in my example). This will launch a new Firefox window and paste the content of the clipboard to the Firefox address bar. By default, this should launch a Google search. If whenever you copied an URL address to your clipboard, this will open the page at this address instead of doing a search.
In my experience, this worked from almost any window. Occasionally, I had issues when trying to launch the group from some apps (I do not remember which ones, unfortunately). In this case, just switch to another app or to the Desktop and launch the group again.
Note about browsers: I tested this tip with Firefox, Chrome and Internet Explorer and it worked well, using Google for the search or Bing in IE. Of course, in any browser, you could have selected the search site of your choice. Also, in my tests with IE, an extra tab was opened for the search. Finally, if you want to use this tip with Microsoft Edge, you will have to wait for the release v9.1 of Quick Access Popup that will provide better support for Windows Apps like Edge. For now, Edge could not be launched by QAP.