This Week's Sponsor:

Incogni

Put an End to Spam, Scams, and Robocalls on Your iPhone


Alfred 2: Rewritten From The Ground Up, Workflows, Themes, and More

Alfred is one of the few apps that I can honestly say have changed the way I use my Mac. I remember the first time I downloaded Alfred back in 2010, the 0.4.1 beta had just been released. I was frustrated with the complexities of Quicksilver and wanted to try something different so I downloaded that early version of Alfred. I remember thinking it was nice, had a small handful of useful features, but ultimately I got bored and deleted it. I hadn’t even given the app another thought until Apple launched the Mac App Store and Alfred was one of the apps to be initially available in the store. I downloaded the free version and not even a week later I had purchased the PowerPack. I lost countless hours of my life scripting extensions to do anything and everything. Over the next 2 years the app received incremental upgrades adding new features with each release. This led to an overwhelming and hard to navigate labyrinth of settings and preferences.

Alfred 2 doesn’t feel like an incremental upgrade to the original app. I think it could be better described as a fresh start. Rebuilt from the ground up, Alfred 2 sports a more logical preference structure that has been simplified for easy navigation without losing any features from version 1. Most notably, the developers replaced extensions with more powerful workflows. The user interface is larger, cleaner, and has new Retina-ready icons.

User Interface

Before we get to the real meat and potatoes of Alfred 2 – which are the new workflows – I wanted to highlight some of the enhancements to the user interface. When you think of Alfred you probably think of task automating extensions or quick keyboard access to your favorite web APIs more than customizable user interface. In fact, if you are like me you often forget that Alfred even has much of a UI to interact with. My years of using Alfred have ingrained extension keywords into my finger muscle memory to launch extensions (and now workflows) so quickly I barely have time to see the little Alfred window pop-up.

Some users, however, enjoy spending time customizing the look of Alfred and now will have some new options to do so. For example, in addition to all of version 1’s color selection options, users can now choose from different fonts, font sizes, and even change the spacing in between search results. I generally run the default Alfred theme ‘Light’, but after playing with some of the customizations I found that I really like using a monospaced font like Menlo with a decreased font size for the sub-text.

Another new feature is the ability to share your theme with a custom URL; you can even shorten URLs with a service like Cloudapp or Droplr and share them, like I did for my current theme.

I would say the most significant UI change is really in the new preferences window. Alfred Preferences is actually a completely separate app now which should keep the core Alfred application lightweight and less bloated. Interestingly, the original Alfred file size was 2.3 MB and now with the preferences removed the core Alfred 2 app is a mere 131.9 KB. As for memory usage, I found that the new version does use more memory than the original version but not by a significant amount. Alfred 2 seems as fast and responsive as ever.

A great example of the improved UI in the preferences window is the Advanced tab. The settings that were once buried inside a window with 5 sub tabs are now easily accessible all from one large and simplified panel. Below is a comparison of the Advanced tab for the two versions of Alfred (click for full size).

Workflows

The hot new feature in Alfred 2 is definitely the new workflows. Let me start with a brief explanation of what they are. Workflows are a PowerPack feature that can be thought of as an evolution of the original extensions. You are still running scripts, launching hotkeys, filtering files, etc… except now you have more options, flexibility, and a graphical canvas to wire-up your inputs and outputs. What was previously impossible or needed multiple extensions to accomplish, can now be neatly packaged into a single workflow. Newly added is the ability to feed results from a script back into Alfred’s search results, certainly a welcome addition by anyone that has ever made a complex extension. David Ferguson’s Weather workflow, which I will mention again in the section of workflows to check out, is a great example of how users can now tie together multiple actions and outputs in a single, coherent workflow.

Workflows are broken into 4 parts:

  • Triggers
  • Inputs
  • Actions
  • Outputs

Some of these are self explanatory but just to be thorough Triggers can consist of things like pre-configured hotkeys to run a workflow or even actions on a specific file currently selected in Finder. Inputs are things like keywords that may be typed in to Alfred or scripts that when ran feed results back into Alfred. Actions are the executable items, e.g. scripts, that run on the inputs. Outputs are exactly what you would expect – notifications and such.

If you didn’t have the opportunity to play with the Alfred 2 beta and have never made a workflow before, then I would highly recommend you start by just reviewing some of the example workflows that the developer included with the app. You can access them by clicking the plus sign in the bottom left corner of the new workflow section of the preferences and choose ‘Examples’. When you are ready to actually make a workflow, be sure to checkout the pre-defined templates to get you started. They are located in the same location as the workflow examples and cover a wide variety of situations.

You will likely eventually want to create a workflow that adds items into Alfred’s search results to display information to the user or to provide choices for the user to click on. As an example of what that might look like, again I will rely on David’s weather workflow as a sample. You will see he has the script filter triggered by the keyword ‘Forecast’ that adds the weekly forecast as items in Alfred’s search results:

To learn how to accomplish this, I would start by reading through the Script Filter XML Format example because it is an extremely simplistic breakdown of the xml format used by Alfred to programmatically feed items back into Alfred’s search results.

Here is a code snippet from that example:

Essentially, to get items to show up in Alfred’s search results you just need a script filter that outputs this xml-formatted string, and each <item> tag will show up as a line in the results. So this code snippet would display ‘Desktop’ as a search result item and “~/Desktop” would be the sub text below.

I have seen so many creative uses for this feature already and that was just during the limited beta. One of the most promising aspects of Alfred 2 has proven to be the community of passionate workflow creators willing to help each other and share their work. There is a new alfredforum.com website provided by the developer where users can ask questions, get help with their workflows, and also check out those that have been shared by others. There are some real gems in the forums.

Perhaps the most interesting work to come out of the community I have seen so far is the push for re-usable tools. I love the thought of saving time while writing workflows.

Two of these re-usable utilities are David Furgeson’s PHP Workflows class and Daniel Shannon’s Python module — PyAl. Both are simple to integrate into your workflow and are well documented as for what repetitive tasks they can automate for you. For example David’s class can quickly convert an array of items you would like to display in Alfred’s search results into properly formatted XML with a single line of code. The Python module also has this functionality and boasts the ability to store credentials in the keychain as well, which may come in handy if your workflow integrates with web APIs that require usernames and passwords.

I don’t want to make workflows, just give me some

You don’t have to write complicated script filters to get Alfred to do some pretty neat things. Perhaps you aren’t interested in making workflows at all and you would just like to download some cool, already made workflows to get the most out of Alfred. I have pulled together some of my favorite workflows that I have come across so far during the beta testing period that are definitely worth checking out.

Weather Workflow via David Fergueson

The Weather workflow for Alfred 2 is a somewhat of a remake of my previous weather extension for Alfred 1. With this extension, you will be able to set your default weather location and then quickly check current conditions, or the forecast for your location.

Migrate Custom Searches and Snippets via David Ferguson

A simple workflow that will assist you in migrating Alfred 1.x Custom Searches and Snippets to Alfred 2. Install and type ‘migrate’ into Alfred to be provided with options of which action to run.

Open SSH with fuzzy autocompletion via Isometry

A workflow to open an ssh session (using the default ssh: protocol handler) with fuzzy host autocompletion (based on the contents of ~/.ssh/known_hosts and /etc/hosts)

Colors — a CSS color workflow via Tyler Eich

It can convert Hexadecimal, RGB, RGB percent, HSL, and CSS named colors to each other format. It can also handle 32-bit Hexadecimal (has alpha channel), RGBA, RGBA percent, and HSLA formats.

Rdio Workflow via David Ferguson

The Rdio workflow for Alfred 2 will allow you to control your local Rdio application, search for tracks, artists or albums to play, and also provide you with information about the currently playing track.

Gitfred: An Alfred 2 worflow for GitHub via Don Southard

I thought I would share my first workflow I created for the beta Alfred v2 called Gitfred. It is a workflow for interacting with your GitHub account, specifically for quickly launching repos, issues, and gists.

Finally saving the best for last, AlfredTweet 2. This workflow is so detailed and full featured, it feels like a mini-app within Alfred. It has username autocomplete for mentions and DMs. You can view your recent mentions and quickly reply. It is an extremely useful workflow. David has an awesome blog with even more really great workflows.

AlfredTweet 2 via David Ferguson

Quickly compose and send new tweets to all your followers, or send direct messages to your friends. You can also quickly reply to the last person who mentioned you.

If you think I missed a great workflow, or you have one of your own you would like to share, feel free to send us a link via email or twitter and we will consider updating the post to include it.

Wrap-Up

Overall, Alfred 2 lived up to my expectations and I feel satisfied with the new version. The workflows feature is unique and useful enough that I feel comfortable saying that feature alone is worth the price of the PowerPack license. Being able to manipulate Alfred’s search results scratches a personal itch I have had ever since my first extension to convert movie files with Handbrake and wanting to display conversion details in Alfred’s window. Now, with Alfred 2, that would actually be possible.

If there was one thing that I would have loved to see ship with Alfred 2, it would have been an easier method for finding, installing, and updating extensions directly from Alfred. I am sure the community will still find some crafty ways to update extensions remotely, however a native option would have been a killer feature.

For existing Alfred fans, Alfred 2 is a no brainer. If you are on the fence, you should download the free version and also check out the forums for inspiration on what you could do with a PowerPack license. Alfred 2 is available from the developers’ website as a free download and for even more features, including workflows, you can purchase  a PowerPack license.

Access Extra Content and Perks

Founded in 2015, Club MacStories has delivered exclusive content every week for nearly a decade.

What started with weekly and monthly email newsletters has blossomed into a family of memberships designed every MacStories fan.

Learn more here and from our Club FAQs.

Club MacStories: Weekly and monthly newsletters via email and the web that are brimming with apps, tips, automation workflows, longform writing, early access to the MacStories Unwind podcast, periodic giveaways, and more;

Club MacStories+: Everything that Club MacStories offers, plus an active Discord community, advanced search and custom RSS features for exploring the Club’s entire back catalog, bonus columns, and dozens of app discounts;

Club Premier: All of the above and AppStories+, an extended version of our flagship podcast that’s delivered early, ad-free, and in high-bitrate audio.