Alfred 5.5 is here - Find out what's new

Launch a URL in 3 browsers from Alfred or Remote

When working on a web design project, the most time-consuming part is often testing in various browsers. To solve this problem, I created a little workflow that would allow me to quickly launch a URL in three browsers at once by tapping an icon on my Remote.

In this tutorial, I'll show you how you can create this workflow in just a few minutes. I also hope it will inspire you to find those small-but-repetitive jobs in your own day that you can replace with workflows or Remote actions to become more productive and less burdened by tiresome tasks.

Creating a Remote action is a two-step process; First, I'll create the workflow itself, choosing the actions I want it to perform. Then, I'll add it to the Remote page.

If you're completely new to workflows, take a look at this tutorial on creating a workflow without a single line of code, which goes in a bit more detail to get you started.

Creating a workflow to launch in multiple browsers

The first step is to create a new workflow. I started with a blank workflow, gave it a name and icon. I then added one "Keyword" input and three "Open URL" actions from the + in the top right of the workflow page. I connected my keyword to all three actions, then proceeded to set each one up.

Screen Shot 2015-02-24 at 10.03.33

When setting up the keyword, I assigned it the keyword "test" with a required argument, which will be the URL I'll type or paste in.

Screen Shot 2015-02-24 at 10.06.04

I double-clicked each of the "Open URL" actions, adding {query} as the URL; This means that the text I type after my "test" keyword will be passed on as the URL each browser needs to launch. Of course, I also choose a different browser for each one, so that it launches in Safari, Chrome and Firefox.

Screen Shot 2015-02-24 at 12.04.02

I now essentially have a functioning workflow, as I can type test http://alfredapp.com into Alfred and press return to launch it in all three browsers.

Screen Shot 2015-02-24 at 12.07.53

However, as I want to use this workflow in Remote, I also need to add a Remote trigger object. I connect this Remote trigger directly to all three "Open URL" actions; I'm not connecting it to the "test" keyword as I want the action to launch the browsers, not pop up Alfred with the "test" keyword.

In this case, I decided that I want the Remote action to use my current selection in OS X as the {query} argument. You could choose to use the current clipboard content if you prefer or choose to use text and enter a fixed URL if you're always testing the same site. I've also given the trigger a unique identifier, an icon and a name.

Screen Shot 2015-02-24 at 12.09.31

Adding the action to your Remote

Now that I've added a Remote Trigger to the workflow, I can add this action to a Remote page. To do this, I go to the Remote tab in Alfred's preferences on my Mac.

I want to add the action to an existing Remote page; Clicking on an empty space brings up the list of actions I can add to my Remote. Under Run Workflow Trigger, my "Launch in 3 browsers" workflow contains the single action created earlier.

And here we go, there's a new action on my Remote page called "Test all browsers". Tapping it from my iPad will make my Mac launch the URL I've selected in OS X in the three browsers I want to test in.

IMG_0297

Tweaking workflows to your own needs

You can download the workflow I've created from Packal, or follow the steps above to create it yourself. You can also grab the icon I created for the workflow or create your own.

When creating or importing an existing workflow, don't forget to customise it to your own needs. For example, I could add a hotkey, similar to the Remote trigger, which launches the workflow with either the OS X selection or clipboard contents. I could add multiple keywords where various pre-defined sites are launched if I know that I'm always testing the same few websites.

I hope that this tutorial will give you a glimpse into how flexible workflows and Remote actions are, and how you can ease the pain of repetitive tasks by creating your own workflows.

Want to see anything in particular in the next tutorial? Tweet us (@alfredapp) your ideas and I'll cover a few over the coming weeks :)

Latest Blog Post:

Video Tutorial: Using Web Searches and Creating Custom Searches in Alfred

CacheFly Campaign Monitor

"Alfred" is a registered trademark of Running with Crayons Ltd. ©2024 Running with Crayons Ltd. All rights reserved.

Terms & Conditions, Privacy Policy, Cookies.