Streamline Your Search With Google and Actions

Google-Fu

I’m sure that by now you harbor no doubt that Actions is a powerful tool. Its versatility rivaled only by its good looks and the things you can accomplish, limited only by your imagination. OK, I’m exaggerating a little since it does have limitations, but the point I’m trying to make is that with a little bit of creativity, you can combine Actions with tools and services you wouldn’t normally think about – case in point: Google Search.

Over the years, Google Search has evolved beyond a mere search engine. It can inform you of the weather, stock and perform conversions to name just a few things. You can read their extensive documentation to learn more.

Download this article's set

Before You Begin

You can use any of the major browsers and things should work much the same. Safari, Chrome and Firefox share similarities that make this possible: When opening a new tab, the address bar is automatically in focus and unless you’ve chosen differently, each will use Google as their search engine when you type a query into it.

Safari however behaves differently in that it retains focus on the address bar after performing a search. This presents a small obstacle, easily overcome by adding three additional actions to the Flow:

  1. A wait action giving the search time to complete;
  2. A snippet action with the following bit of code javascript:document.getElementsByName('q')[0].focus(). This bit of code simply moves focus to the search field (you’ll see later why this is important);
  3. A shortcut with enter.
TIP: If you recall from the previous articles, you can add a carriage return in the snippet of text. In this particular case I’d advise against it. Given that you’re typing into the address bar and it has autocomplete (history, bookmarks etc.) that carriage return could simply trigger one of those items and not the intended action.

Since you can’t use Actions to type, every search (and some utility) Flows will use selected text as the query term. In essence, you select a portion of text and then trigger the Action.

Search

Given that it’s possible to perform various types of searches, you need specific Flows for each. Let’s start with a simple one and then build on from there.

Normal Search

This is the most basic of searches you can perform in Google. Create a Flow with the following actions:

  1. Choose Current Application as the target and then create a shortcut with cmd+C (Mac) / ctrl+C (Windows). This will allow you to copy any selected text in the current app;
  2. Now, targeting the browser of your choice add another shortcut to create a new tab, cmd+T (Mac) / ctrl+T (Windows);
  3. Add another shortcut with cmd+V (Mac) / ctrl+V (Windows) to paste the previously copied text;
  4. A shortcut action with enter;

If you’re using Safari, remember to add the three additional actions, otherwise your Flow is complete.

Exact Match Search

Often enough, that first Flow will be just enough. There are times however when you’ll need an exact match for a specific term or phrase. In Google, you accomplish this by enclosing the search term in parenthesis. Just as before, create a new Flow with:

  1. A shortcut action with cmd+C / ctrl+C, targeting the Current Application;
  2. A shortcut with cmd+T / ctrl+T targeting the browser of your choice;
  3. A snippet action with ;
  4. A shortcut with cmd+V / ctrl+V;
  5. A shortcut with a right arrow. This will de-select the text and place the cursor at the end (just playing it safe);
  6. Another snippet action with ;
  7. Once again, if you’re using Safari add the final 3 actions.

In Title & In Url

It’s also possible to search for a term in a link’s Title or URL. Both Flows are identical, with one small exception.

  1. A shortcut action with cmd+C / ctrl+C, targeting the Current Application;
  2. A shortcut with cmd+T / ctrl+T targeting the browser of your choice;
  3. A snippet action with intitle: or inurl:;
  4. A shortcut with cmd+V / ctrl+V;
  5. A shortcut with enter;
  6. The final 3 actions for Safari users.

File Types

Google also allows you to search for indexed documents containing the search query. Simply append a filetype:pdf to your search to search for PDFs.

  1. A shortcut action with cmd+C / ctrl+C, targeting the Current Application;
  2. A shortcut with cmd+T / ctrl+T targeting the browser of your choice;
  3. A snippet action with ;
  4. A shortcut with cmd+V / ctrl+V;
  5. A shortcut with right arrow;
  6. A snippet action with filetype:txt. Notice that this snippet has a preceding space;
  7. Once again, Safari user should add the final three actions.

Tip: Enter edit mode, tap and hold with two fingers to duplicate the action and change file type. Afterwards, add each File Type action into a subset

Site Specific Search

Google allows you to restrict your search to a specific site or URL. Performing a search with Flows site:getactionsapp.com will search for the term Flows only in getactionsapp.com. This is particularly useful if you search a particular site often enough, such as Stack OverFlow or Actions support site.

All you need to do is duplicate the previous actions, Normal Match and Exact Match, add them to a new subset and change them ever so slightly.

For Normal Match create a Flow as follows:

  1. A shortcut with cmd+C / ctrl+C targeting the current app;
  2. A shortcut with cmd+T / ctrl+T targeting your browser of choice;
  3. Add another shortcut with cmd+V / ctrl+V to paste the previously copied text;
  4. A shortcut with right arrow;
  5. A snippet with site:getactionsapp.com. Once again notice the space at the beginning of the snippet;
  6. A shortcut action with enter;
  7. The final 3 actions for Safari users.

Exact Match is just like before, only this time, instead of the final snippet being just , you add site:getactionsapp.com".

Trigger Results

All these Flows are excellent, but not much help if you still have to reach for your mouse to trigger a result. Fortunately, Google has a shortcut for this. Pressing the tab key will focus on the first result (a blue arrow will appear next to it), and then arrow down/up will move between results (This is the reason for the small javascript workaround, without which a tab would simply move focus to the next UI Element).

To trigger the first result, create a Flow with three shortcuts, a tab, another tab and finally enter. To trigger the second result, duplicate the previous action, but this time, before the enter, add a down arrow. That would be tab, tab, down arrow and enter. For each additional level, add another down arrow. So third result will have two down arrows, forth three and so on. Remember to group them all in a subset to keep things organized.

First Exact Match

Now that you’ve seen how to trigger results, why not combine two Flows to achieve greater speed. Perform an exact match and trigger the first result immediately.

  1. A shortcut action with cmd+C / ctrl+C, targeting the Current Application;
  2. A shortcut with cmd+T / ctrl+T targeting the browser of your choice;
  3. A snippet action with ;
  4. A shortcut with cmd+V / ctrl+V;
  5. A shortcut with a right arrow. This will de-select the text and place the cursor at the end (just playing it safe);
  6. Another snippet action with ;
  7. The 3 Safari actions, if you’re using Safari of course;
  8. A shortcut with tab;
  9. Another shortcut with tab;
  10. Finally a shortcut with enter.

Utility Flows

Now that you’ve gotten a feel for search , let’s tackle a few of the other aspects I previously mentioned.

Current Time & Weather

Google can inform you of current weather conditions or local time in a specified location. In order to harness that power with Actions, create a Flow with:

  1. A shortcut action with cmd+T / ctrl+T targeting the browser of your choice;
  2. A snippet action with either time in New York or weather in New York;
  3. A shortcut with enter.

Now duplicate this action and add as many locations as you desire. Don’t forget to keep things organized with subset.

Convert Currency

If you’re like me and often purchase goods oversees, it can help to know the value in your local currency. I’ve created a few Flows for this:

  1. A shortcut with cmd+T / ctrl+T targeting your browser;
  2. A snippet with currency:euro to usd will show you how the current value of the Euro compared to US Dollar;
  3. A shortcut with enter.

If however you’d like to know the exact conversion of a specific value, then create a Flow with these actions:

  1. A shortcut with cmd+C / ctrl+C. Ideally this should be used to copy a numerical value;
  2. Shortcut with cmd+T / ctrl+T targeting your browser;
  3. A snippet with currency:;
  4. Shortcut with cmd+V / ctrl+V;
  5. Shortcut with right arrow;
  6. Another snippet with euro to usd (Notice the preceding space);
  7. A final shortcut with enter.

General Conversions

You can create as many Flows as you need to perform general conversions. Duplicate the Flow to convert currency, but this time, omit the initial snippet with currency: and replace the second snippet with whatever you’d like to convert. meters to feet, kilos to pounds, minutes to seconds. Google will handle pretty much anything you throw at it.

Translate

The final utility I’d like to show you is how to translate small snippets of text. Create a Flow that:

  1. Copies some text;
  2. Creates a new tab;
  3. Pastes a snippet with translate;
  4. Pastes the copied text with cmd+V / ctrl+V;
  5. Pastes another snippet of text with the language you wish to translate to, for example english;
  6. A final shortcut with enter.

Now simply copy some text and trigger the action. Google will do a good enough job of identifying the origin language so no need to specify that.

In Conclusion

It should be abundantly apparent by now just how versatile and powerful Flows can be and that with a little creativity you can bend many services and apps to do your biding. Are you using Actions in conjunction with other web services? Have an interesting use case with google search? Then sound off in the comments, we’d love to hear from you.

Pedro Lobo

A System Administrator by day and freelance technology writer by night. I put words together to express my opinionated views on software, hardware or anything that strikes my fancy. Said words can be found in a variety of places, among which my blog. When not spending time with my family and taking photographs, I can be found on app.net or Twitter