Tutorial: Creating the Fastest Hotkey-Based Web Search
Some of the most useful workflows are the simplest.
In this post, you'll discover how to create a hotkey-based workflow which allows you to launch a web search for your current macOS selection or clipboard contents. It's an incredibly quick way of searching the web without re-typing your query, or manually launching a search.
First, let's take a look at my basic workflow.
Each of these two workflow streams consists of two objects; A Hotkey Trigger and a Default Web Search Action.
Taking a look at the first stream at the top, the hotkey is configured to pass the Selection in macOS as argument.
This means that, when text is selected in macOS, pressing the hotkey combination will pass this text on to the next object. In this instance, the next object is a Default Web Search, set to use Alfred's default Google Search and your default browser.
The Default Web Search object is left as default; Google web search, and default browser.
You've now created your first workflow stream, so select some text in macOS and press your hotkey combination to launch a Google search for that text in your default browser.
To create the second stream, select the first two objects, and copy and paste them below. Modify the Hotkey object slightly by setting a different hotkey combo, and choosing "Clipboard Contents" as argument. This hotkey will now trigger a Google search for the last text you copied to your clipboard!
Customising the Workflow
Now that you've created the workflow, you can add other streams and customise them as you need;
- Change the Default Web Search to another search engine like Wikipedia, Amazon, IMDB, Twitter, Google Images, etc.
- Use an Open URL Action with one of your own custom searches for your own work documentation or resources.
- Open the results in a specific browser, rather than your default one.
- Set the second object to be a different action like launching a custom URL where the argument becomes a {query} within your URL.
- Passing the argument to an Output object like Large Type or Write File.
Take a look at how these hotkey-based workflows can save you time and clicks as you go through your day, and create your own variations.