Alfredtricks Weekly#2 : Alfred "Web Search" edition.
Paris. Sunday 13th, 2020. 12 am.
A friendly and productive “Bonjour”, a French version for “Hi”, from (still) cold and (still) grey Paris 🥐🥖☕ !
Thank you for subscribing and welcome to the second issue of Alfredtricks Weekly, your weekly dose of Alfred that makes you more productive!
While any Alfred user would take advantage of reading this newsletter, you will definitely make the most of this newsletter if you have the Alfred Powerpack already installed on your Mac. You can get more information about the Alfred Powerpack here.
Alfred’s web search of the week:
Let’s wait no time and dive into what Alfred has to offer us in terms of “Search”.
“Search” is a wide topic as I will understand it as the way to display in front of my eyes the information I am looking for. It doesn’t matter whether it is on a web page, a document, an image… Alfred has, as in many areas, a lot to offer in “Search”.
In this Alfredtricks Weekly#2 issue, I want to focus on what is called “Web Search” in Alfred terminology. “Web searches” are, as the name imply, simply a faster way to query the web. Instead of querying the World Wide Web, you will perform a search on a specific website.
If I am looking for an icon about let" say “Alfred”, I fire the Alfred search bar, type the “Web Search” keyword plus my query, here “Alfred”, hit Enter and voila. In front of my eyes, appears the results of my query from a specific website (iconfinder.com for example), in a tab of the browser I want.
You might think: “Nothing groundbreaking.” And you would be right.
But have you ever listed all the tasks you have to perform without Alfred to get the same result?
If not already opened, open the web browser you want your results to be displayed in.
Wait for this task to be completed
Open a new tab
Select the browser address bar
Type the name of the website your want to perform your query against (and make no typo)
Hit enter
Wait for this task to be completed
After 9 years of using Alfred I enjoy doing those lists from time to time when I am using the Alfred “Web Search” feature not only to remind me how taking one minute or two to create a “Web Search” made me spare a lot of time over these years.
The more these “Web Searches” became ingrained in my mind, plus, as they are a great way to hone my search even before hitting the “Enter” button, they really helped me stay in a flow state. No focus break.
You have multiple ways to create Alfred “Web Searches”. The simple one is in Alfred preferences > Features > “Web Search”. Hit “Add Custom Search” and follow the instructions of the pane just like in the following example.
Here, you have a Product Hunt “Web Search”. In short, it is a Google Search in a specific website (https://www.producthunt.com/) from Alfred search bar.
From Alfred search bar type the Alfred “Web Search” keyword sphu (for Search Product Hunt), a space, your query, hit “Enter” and your default web browser will display the results of your search from www.producthunt.com.
To add this Web search to your collection, copy the on the following link in your favorite browser:
alfred://customsearch/Search%20Product%20Hunt%20/sphu/utf8/nospace/https%3A%2F%2Fwww.producthunt.com%2Fsearch%3Fq%3D%7Bquery%7D
It will just ask you to import this “Web Search” in Alfred. As simple as that.
While this works, from my experience, 90% of the time, sometimes you can’t perform an Alfred “Web Search on a website. Imagine the Product Hunt website url being always of the format www.producthunt.com and not of the format https://www.producthunt.com/search?q= when using its search feature.
It would mean I would have no way add {query} to perform my query from Alfred search bar.
So, how to fill the “Search URL” form?
The trick here is to use your favorite search engine to search the website, for example crunchbase.com, not with its search feature (if it ever has one) but with your favorite search engine, for example Google Search.
With the website crunchbase.com and the query “alfred”, you would have gotten the following url from google.com search page results:
https://www.google.com/search?sxsrf=ALeKk03AP4sVIZcozRtz1CadnPkp8RtvlQ%3A1607852766328&ei=3uLVX_y2E4a9UISoq5AI&q=alfred+site%3Ahttps%3A%2F%2Fwww.crunchbase.com%2F&oq=alfred+site%3Ahttps%3A%2F%2Fwww.crunchbase.com%2F&gs_lcp=CgZwc3ktYWIQA1CjDljrKWDOK2gAcAB4AIAB-AGIAd0LkgEGMTguMy4xmAEAoAEBqgEHZ3dzLXdpesABAQ&sclient=psy-ab&ved=0ahUKEwj8nfOn1srtAhWGHhQKHQTUCoIQ4dUDCA0&uact=5
A little bit messy, I know. Now, we have to clean it and make sure we can perform any query we want, not only query “alfred”.
It is very simple as you just need to trim the url so that you get this url:
https://www.google.com/search?sxsrf=ALeKk03AP4sVIZcozRtz1CadnPkp8RtvlQ%3A1607852766328&ei=3uLVX_y2E4a9UISoq5AI&q={query}+site%3Ahttps%3A%2F%2Fwww.crunchbase.com
I just removed all the content after the first occurrence of the website I perform the query against (here, www.crunchbase.com) and replaced the first occurence of my query (here “alfred”) by {query}.
It is a try and and test technique. But, most of the time, it only takes a few seconds to make Google Search results page url “Alfred compliant”.
An even simpler way, if you do not want to have to trim any url, you can use the following Google Search url format and replace “crunchbase.com” by the website you want to perform the query against.
https://www.google.com/search?q=site%3Acrunchbase.com+{query}
While this technique requires a few extra steps and get your hands (a little) dirty, it is an effective one, as now, I can search anything I want on crunchbase.com from Alfred.
And 99,99% of the time, perform any query I want, in any specific website I want, from Alfred search bar.
Note: you can also activate OpenSearch and SearchAction by clicking on the Lookup button to help Alfred try to discover the custom search and create your “Search URL”. As it only works if supported by the website you want to perform your query against, it is not working 100% of the time. Because of that, I haven’t really been using this feature a lot over the years.
Alfred’s tip of the week:
Using Google Search to perform a query in a specific website is not only a workaround but also fantastic to tool improve your search capabilities as you can take advantage of Google Search operators.
For a list of Google Search operators, please see this article of Joshua Hardwick on harefs.com here.
In other words: if you repeatedly perform advanced queries on a specific website, or on google.com, you can set an Alfred “Web Search” once, and instead of having to type those no so easy to remember Google Search operators every time you want to perform them, you will just have to type the keyword of your Alfred “Web Search” plus your query.
With all those Google Search operators the sky is really the limit.
Live from twitter.com/alfredtricks:
A great reminder to follow the Alfredtricks Twitter account (@alfredtricks) where I publish Alfred and productivity related content every day.
From last week, I especially recommend you this article from lifehack.org on how to crush habit forming.
We often want to change. We often know what we want to get from change (more money, quit smoking, loose weight, travel more, spend more time with family…).
While key to our success, we more rarely have a clear vision on how to make sure we create the habits (simply said actions repeated over and over) that will make us closer to reaching our goals.
This article and those in the “Productivity resources of the week” are here is here to help you to improve your habits and crush your goals.
Productivity’s resources of the week:
First, let’s not confuse habits and routines with this article of Nir Eyal from www.nirandfar.com (When to prefer routines to good habits so they do not backfire and prevent you to become more productive).
Second, let’s get rid of bad habits with this article from www.dumblittleman.com (Create new habits can help you become more productive. But they won’t help if you do not get rid of your bad ones. Here is how).
Third, let’s create a chain reaction of good habits with this article of James Clear from jamesclear.com (What a women trying to make her bed four days in a row can teach you and help you increase your productivity dramatically).
Happy reading!
Thank you!
Until next week, have a productive one!
François-Albert.