Tutorial: Using the same keyword for multiple actions

Today’s tutorial takes a look at how you can create a workflow using the same keyword for multiple actions.

Generally, it’s preferable to have unique keywords, so that you can type it, hit the Return key and launch the workflow. However, when you have a set of similar actions to perform that you don’t use everyday, it can be a useful way to group them together. Remembering numerous rarely-used keywords can be inconvenient when you have a memory like a sieve!

For example, I use Safari as default browser, but need to view sites that requires Flash in Chrome, so I first set up a workflow that launches the Fitbit website in Chrome. I then added two more actions to launch different pages to log activities and sleep when I’ve forgotten to wear my wristband. (What did I say about being forgetful?)

As you can see, the keyword brings up four items; Three workflow entries and the Fitbit Connect app. The most frequently used result (the website) appears at the top of the list, but the other actions are also conveniently available for occasional use.

fitbit_workflow

To set up this workflow, I simply connected each action to a separate, but identical keyword. If I had connected the three “Open URL” objects to a single keyword, Alfred would have presented me with a single results, and all three pages would have launched at the same time when I hit Return (which can also be useful, but wasn’t the objective here).

fitbit_workflow_setup

In this case, all keywords except for the Fitbit Connect application are part of the workflow, but you could also use the keyword for a custom search if the website had a searchable documentation section.

Enjoyed this short tutorial? You’ll find many more in the Tutorials section of the blog.

10 Great Uses for Alfred’s Hotkeys

One of the best tools in the productive Mac user’s bag of tricks is undoubtedly hotkeys. We can all remember that first lightbulb moment where learning the basic shortcuts in OS X gave us that instant productivity boost!

With Alfred, you can kick this keyboard control into high gear. In this post, I’ve gathered ten of my favourite uses for hotkeys, so take a look at how you can improve your workday by adopting these tricks and creating a few handy hotkeys of your own.

In order to use some of the features below, you’ll need the Powerpack.

1. Launch applications, files or websites

Start your day with focus by using a hotkey to launch the websites, applications and files you need. For example, this workflow launches Mail and Safari, the Alfred forum and my to-do list text file, which makes it easy to kickstart my day while having my first coffee of the morning.

You can connect hotkeys to almost anything in a workflow, so there’s no need to pop up Alfred and type a keyword.

morning links workflow

2. Use the Cmd, Ctrl & Alt modifier keys with Return

When using Alfred’s search box, pressing return will open the application, file or website you’ve selected. Using modifier keys, your return key can do more. Press the modifier keys and you’ll see your results’ subtext change to an alternative action.

modifierkeys

You can change what each modifier key does in the Advanced preferences tab.

3. Launch Alfred with a File Filter

Let’s say you frequently search for PDF documents on your Mac. You can drastically speed up your search by using a hotkey to jump straight to a file filter workflow; No need to launch Alfred and type the keyword for your PDF search workflow.

Press your assigned hotkey to pop up the search box with the file filter already active. Your filter is identified by its icon on the left of the search box.

pdffilter

Download my PDF File Filter Workflow to see how simply you can create your own filters.

4. Large Type

Press Cmd + L to show any text in Alfred in large font across your screen. Handy for seeing phone numbers from across the room (or to share silly messages with everyone behind you in class!)

largetype

5. Paste as plain text

Paste text from the clipboard as plain text without showing the Clipboard Viewer with this handy little workflow.

6. File selection

Found a file in Finder you need to take action on? Select the file and pop up Alfred’s File Action panel with the Cmd + Alt + \ hotkey.

You can even create your own actions and add them to this panel with a “File Action” workflow object for tasks you repeat often.

fileaction

7. Speeding up hotkeys in workflows

This isn’t a hotkey as such, but a way to make your existing workflow hotkeys perform their task even quicker.

To ensure that hotkeys always work smoothly on your Mac, Alfred waits a few milliseconds before letting the modifier keys (alt, cmd, ctrl) go before performing the action associated to your hotkey combination. If you want to speed this up, you can change the trigger behaviour to pass the modifier keys through and give you faster hotkeys.

Right-click on the hotkey field in your workflow object to show the hidden menu below.

hotkeys-settings-fastest

8. Get to the Preferences quickly

Like most OS X applications, Alfred uses the standard Cmd + , (Cmd + comma) to open its preferences, so you can quickly put into action the new things you’ve learned here.

9. Contextual hotkeys

When setting a hotkey in your workflow, you can specify when you want the hotkey to be active by including or excluding applications. Just drag the related apps in!

contextualhotkeys_fade

10. File Buffer

If you need to take action on multiple files at once, the File Buffer is the best way to stack up the files you need before performing an action on all of them.

Use Alt + Up arrow to add a file to the buffer from Alfred’s results and Alt + Right arrow to take action on all of them. For the full set of File Buffer shortcuts, go to the File Search > Buffer preferences or have a look at the File Buffer support page.

Fancy discovering more great productivity features? Have a look at our Tutorials section for tips, tricks and workflows you’ll love.

Alfred v2.3 Released: Context-sensitive hotkeys, external triggers and more

Hot on the heels of the last release, Alfred v2.3 is now available in in-app update or from our website. It contains an abundance of new Powerpack features focused on workflows, including some very handy improvements for those of you who love hotkeys.

Context-sensitive hotkeys

While many of us can’t live without Alfred’s hotkeys for workflows, these can occasionally clash with hotkeys in other applications. From v2.3, you can now set hotkeys to be active or inactive while particular applications are in focus, to create app-specific hotkeys or disable certain hotkeys while in Photoshop.

With this new feature, you can shake the feeling of running out of hotkeys for good. To set it up, add a hotkey object to your workflow as usual and set your hotkey. Search for the relevant applications in Alfred and drag them from Alfred’s results directly into the “Related Apps” tab. Choose whether you want the hotkey to be active when these apps are or aren’t in focus, and you’re done.

workflow_hotkeys_related_apps

External triggers

You can now use AppleScript from an external source to tell Alfred what to do using the new External Trigger objects.

The possibilities are endless; iCal can execute a script at a particular time or your external app can use this trigger to tell Alfred to display text using the Large Type or Notifications.

Open a set file with a specific app

A simple but very handy addition to the “Open File” workflow object is the ability to select a static file and an application to open it with.

For example, this can be set to open an audio file in a non-default music player or to launch regularly-used reference files in a specific application.

short_circuit_workflow

Workflow defaults for creators

With such a wealth of workflows being created, developers can now set their own defaults so that their name, URL, readme and other important information is included every time they create a new workflow!

These are only a few highlights from the many new features, improvements and bug fixes we included in v2.3. Have a look at the change log for the full list.

Tutorial: Creating an Alfred Workflow Without a Single Line of Code

When we designed the Workflows feature in Alfred v2, our objective was to give users who are not programmers the freedom to create their own workflows. This meant creating a platform that would allow you to drag and drop objects, connect them together and tell Alfred what to do or search without writing a single line of code.

Today’s tutorial will walk you through creating a very simple workflow using Objects – without a single line of code. We’ll create a search for images which then opens your chosen result in Safari. We’ll then wire a hotkey so that you can bring up the search with a custom hotkey.

Why should you use Workflows?

I alluded to this in the previous tutorial about importing and setting up workflows created by other users; Alfred’s core set of features are intended to suit the more general needs of users with features like the Clipboard History, Theming, iTunes Mini Player, etc.

However, in YOUR work day, there are tasks you repeat frequently that you might want to do more efficiently and quickly. This is where workflows are useful; you can create quick ways to trigger actions.

Without a single line of code, you could:

  • Launch your “morning links”: Launch all of your important daily websites with a single hotkey or keyword.
  • Set hotkeys for applications: Rather than type the name of the apps you frequently need into Alfred, set a hotkey to launch it instantly.
  • Filter your search: Remove clutter by filtering your search to only PDF files in your “Work” folder with a keyword
  • Give nicknames to applications: Add the nickname “browser” to Safari, Chrome and Firefox to bring them all up in a search.
  • These are just a few examples, you can do so much more!

Let’s start simply with our image search workflow.

Creating your Workflow

There are two ways to start creating a workflow; You can either use an existing example or template, or you can start with a blank slate and pick your own workflow objects. The examples are a great way to see what can be done with a workflow.

To choose a template, click the + button at the bottom of the workflow sidebar and pick the most suitable template for your needs. You’ll then be able to modify it or connect additional objects to it to do exactly what you want it to do.

To create a new workflow from scratch, select “Blank Workflow” instead.

workflow_example_menu

Give your workflow a name, description and include your own identifier details. You can also drop an image into the image well on the left to give your workflow an icon.

workflow_details_completed

Adding Objects to your Workflow

If you’ve started with a blank workflow, you’ll need to add your first object. For our “Open an image in Safari” workflow, the first object we need is a “File Filter” input. Click the + button in the top right of your workflow and choose Inputs > File Filter.

In my File Filter object settings, I’ve filled in some details and dragged in the four image types I want to include into my search results; jpg, gif, png and tiff files.

workflow_file_filter_img

If you want to search a particular folder, you can use the second tab to narrow down the search scope, but in this instance, we’ll keep the default search scope.

The second object is the “Open File” action. Search for Safari using Alfred, and drag Safari from Alfred’s results into the second box of “Open File” to specify which application the images found should open in.

workflow_open_file_specify_open_with

Finally, let’s add our third object; the Hotkey Trigger. Set a hotkey of your choice.

workflow_hotkey_example

Connecting Objects Together

The only remaining step is to connect our objects together.

Hover over the first object to see the handle appearing on the right edge. Drag a connecting line from it to the left handle of the second object. Do the same connecting the second object to the third.

workflow_connecting_handles

And that’s it, you’ve created your first workflow!

Type “img” into Alfred, followed by the name of an image file you want to search for, then hit return to open the image in Safari. Alternatively, use the hotkey you’ve just set to bring up the workflow.

workflow_file_filter_icon

Exporting and sharing your workflow

Once you’ve finished creating your masterpiece, you can export it to share it. Right-click the workflow in the sidebar and choose “Export…” to create a .alfredworkflow file you can share with fellow Powerpack users.

You can download the “Open an image in Safari” workflow created for this tutorial.

We’ll be publishing many more tutorials over the coming months, so follow the blog by email by clicking the “Follow” button in the blog sidebar or follow us on Twitter.

 

Tutorial: Importing and Setting Up Alfred Workflows

In recent weeks, we’ve published a few posts on some of our favourite Alfred workflows. Some are very simple and others are more complex, but they’re all created using Alfred’s building blocks, the workflow objects.

This tutorial will help you understand what a workflow is, how to import an existing Alfred workflow and set it up to get started with it.

What are workflows?

Alfred has an extensive set of features, both in the free core version – searching your Mac and the web, calculations, dictionary – and in the Powerpack – clipboard, theming, iTunes Mini Player and more.

Yet, we know that you like to customise things even more and control your Mac even more deeply. This is where workflows come in; This Powerpack feature allows you to speed up repetitive tasks and save time by performing many actions at once, even if you’re the only person in the world who needs to perform that task. Who doesn’t want to get work done more efficiently?

You can import workflows created by fellow Alfred users and you can create your own. Here, we’ll look at importing existing workflows and setting them up. In the next tutorial, we’ll look at creating your own from scratch and sharing them with friends.

You’ll find workflows in various places on the web:

  • On this blog, where we often feature some of our favourite workflows
  • On Packal, a fantastic repository for workflows and themes, created by Alfred user Shawn Patrick Rice
  • On the Alfred community forum, where many users share their workflows & discuss their ideas
  • Developers of other Mac apps have created workflows, so you’ll find many more by searching for workflows and the name of your favourite Mac apps

You can also download the very simple file filtering workflow I’m using as example in this tutorial.

Remember that you need to be a Powerpack user in order to use advanced features like workflows, so be sure to activate your license or purchase a license to get started with workflows.

Importing a Workflow

Once you’ve found a workflow you like, you can simply install workflows by double-clicking the workflow file. The workflow files end with .alfredworkflow.

alfred_workflow_import

You can add the workflow to a category, then click “Import” to finish importing. You’ll now see the workflow listed in the left sidebar of your Workflows preferences pane.

Occasionally, you might come across Alfred extensions (ending in .alfredextension); These are the precursors to workflows and date back from Alfred version 1. You won’t be able to import these directly into version 2, but you’ll find that the most popular ones have been re-published as v2 workflows by their creators.

Setting Up Your Workflow

Once imported, most features of your workflow will work instantly. A quick look at the workflow will show you what keywords you can use.

alfred_workflow_keyword

In this example, the keywords are “new” and “old”. Typing the keywords into Alfred will show you what action you can perform with them. In this example, the keyword “new” allows you to filter files to only show documents you’ve modified in the last 3 days.alfred_workflow_keyword_newWhere workflows contain hotkeys, the hotkeys are stripped out when you import the workflow, to ensure that these don’t clash with your existing hotkeys. You can set these easily by double-clicking the hotkey object to show the drop-down where you can set your hotkey.

alfred_workflow_hotkey_setting

Hit save, and that’s your hotkey set!

alfred_workflow_hotkey

What’s next?

The world’s your oyster, son! You can add workflow objects and connect them together to add more ways to search your files. You can change keywords and hotkeys to suit your needs. Or you can modify the file filter by double-clicking it to change what file types are searched or the search scope to search only specific folders on your Mac.

In the next tutorial, we’ll have a look at creating your own workflows and exporting them to share them with friends.

 

Fill Your Head with Tunes: Using Spotify with Alfred Workflows

Over the past few weeks, we featured a few of the apps we really love using with Alfred. While working on each one of these posts, I was listening to music using the service I’m featuring today: Spotify.

To say that we use Spotify a lot would probably be an understatement. At the end of 2013, Spotify released a “Your year in review” page, where you could see some mind blowing aggregate stats for its millions of users, the year’s most popular Monday songs, as well as some of your own usage metrics. Ahem, it turns out that we listened to over 30 non-stop days of Spotify music over 2013.

spotify_usage

It’s fair to say that Spotify pretty much fuels our week musically. Some clever Alfred users created workflows that gives you control of Spotify on your Mac. There are a number of great workflows, and below are two popular ones; a simpler one and a more advanced one, depending on how you like your workflows!

Remember that you’ll need a Powerpack license in order to use workflows.

A Simple Workflow: Spotifious

Spotifious by Ben Stolovitz is a great yet simple workflow that allows you to search and browse music on Spotify. Once you’ve set your hotkey, you can bring it up to see what’s currently playing and browse Spotify’s catalog.

It’s brilliant and requires no setup at all, other than using an up-to-date version of the Spotify app for Mac. The only downside is that searching can only be as fast as Spotify can respond to your query, so you sometimes have to wait a moment before your results appear.

Download the Spotifious workflow from Github.

spotifious_nataly_dawn

An Advanced Workflow: Spotify Mini Player

This workflow is Vincent de Saboulin’s Spotify Mini Player and gives you an even smoother search experience for your Spotify playlists, including showing artwork thumbnails as you browse.

It requires a bit of legwork to get started as you’ll need to sign up for a (free) Spotify developer account, but once you’re up and running, it’s the quickest and prettiest way to search. After setting up the workflow, it took roughly an hour for my library to be scanned and the artwork to be downloaded, but the results were beautifully presented and very fast.

Download the Spotify Mini Player workflow from Github.

spotify_workflow

For those who can’t use Spotify yet

As Spotify isn’t available in all countries, those who are still waiting for the service to launch in their country can choose from the wealth of great workflows for other music services.

For example, users have created workflows for Last.fm and Rdio, and there is of course, Alfred’s integrated iTunes Mini Player.

What’s your favourite guilty pleasure song? If you tell me yours, maybe I’ll tell you mine ;)

Alfred v2.2 Released: Workflow Organisation and Debugging

Today’s Alfred v2.2 release contains some major improvements to workflows, which will be very enjoyable for both developers and workflow users.

We’ve added new organisation, filtering and copying options for workflows, so that your growing collection is easier to sort through.  A key feature for workflow developers is also the new debugging options to help them create the best workflows possible.

Of course, the list doesn’t end there; v2.2 includes loads of significant improvements to many other areas of Alfred. Fancy reading all of the improvements? The change log contains a detailed list, but we’ve included a few highlights for you below.

Workflow Debugging

The debugging tool is a new addition to help developers create and improve the awe-inspiring collection of workflows they’ve made available to fellow Alfred users.

To access debugging, click the bug icon when editing a workflow; Logs will appear as the workflow is used and information can be filtered to show either all information or only the errors and warnings.

debugger

Categorising and Copying Workflows

As we each start collecting an impressive number of workflows, it becomes increasingly useful to categorise them. In this release, you can use the few default categories or create your own, then classify your workflows into “work”, “productivity”, “music”, etc categories and filter down by category. Click on the triangle in the search field of the Workflows search to get started.

We’ve also made it easier to copy and paste workflow objects from one workflow to another with Cmd + C to copy and Cmd + V to paste. You can also duplicate a whole workflow, if you want to re-use a workflow as a basis to create a new one!

You can update to v2.2 by going to the “Update” tab in Alfred’s Preferences or by downloading Alfred from our website. Have a look at the change log for the full list of improvements and fixes in this release.