Working with Files in Alfred

August 19, 2014 by Gabe | [mmd] |

Alfred for Mac is typically thought of a as a file launcher with support for custom actions. But there's an entire set of built in actions for handling files that are easily overlooked. But these are, by far, my most used features.1

Action files from Finder or Path Finder

With any number of files selected in the Finder, hit a user defined key combination to send them into Alfred. Once there, you can manipulate files in pretty much anyway you can in the Finder with a mouse. I commonly use this to open files in an app, for example ImageOptim. My preferred shortcut is ⌘ double tap.

I can select files in the Finder and double tap ⌘ to load them into Alfred, which is ready to act on them instantly.

The possible actions are what makes this feature actually useful. I can do some basic stuff like deleting or opening the files by typing the keyword for the action or just scrolling through the list of actions. Hovering the mouse over a file in the buffer displays some details about it or ⌘+Y to quick look.2

Moving files is much more convenient than working in the Finder. After collecting up the files, I choose the "Move" action followed by triggering the Alfred search to select the new location. Done. The files are moved.

Even this minimal power can be expanded with other utility apps. For example, a Hazel rule to automatically FTP files to a server when I move them to a folder.

Sending files to applications doesn't have to be just about editing or viewing. I regularly send files to ImageOptim to be automatically down-scaled. I could do this with a script or macro, but the default ImageOptim settings work just fine for my needs.

Here's a tip for renaming files with my naming utility of choice, Name Mangler. I use this enough that I wanted a convenient trigger so I created a custom workflow in Alfred and a Name Mangler droplet that automatically renames files dropped on it.

Start by creating a file trigger. In this case I also check the option to function on multiple files. Connect the trigger up to the simple action "Open File" and tell it to use a Name Mangler droplet. Now when I send files to this action, they are renamed with a safe and URL encoded name.3

Search and Buffer then Action

Selecting files in the Finder is fine, but Alfred is very good at quick navigation through browsing or through searching. Alfred has a feature called the file buffer. It's a place to temporarily hold files that you find and want to action as a group. I search and browse in Alfred and gather up files into the file buffer. When I'm ready, I can either action them one at a time in sequence or as a group.

There are some settings to consider for Alfred navigation, including the trigger you prefer to access a previous path, but overall it's simple to use.

You can browse a folder in Alfred by searching and then hitting the → key to drill into it. Alfred also understands paths by using the "/" to start at the root or "~" to start at the user folder. Similar to the Terminal, you can use the ⌘ key to auto-complete the path as you browse. I generally find everything I need without any special tricks. I just search for the name. If you like special tricks you can limit a search to file types by creating a custom filter or be explicit about wanting only files and folders by enabling the "Quick File Search Mode" in the preferences and then prefixing a search with a space character. I rarely use these tricks.

There are a few minor preferences to control how the file buffer functions, but here are my settings:

Use the ⌥+↑ key combination to add the currently selected file to the buffer. Continue to select files one at a time to add them to the file buffer.

These files stay in the buffer until they are actioned or unloaded (based on your settings). To remove a file from the buffer, use the ⌥+← key combination. The files are unloaded in reverse sequential order. Alfred displays a visual queue of how many files are selected right above the search box:

Alfred has more file manipulation features and a bunch more options to control them. I'm particularly fond of that ⌥+C trigger for copying the path for a file. I've also used a custom home folder location for Alfred in the past but I am not at the time of this writing.

Here's a bonus feature. You can use Alfred to quit applications by typing "quit":

Many of these features originated with my Ex-lover, Quicksilver. They are also now available in the latest beta of LaunchBar. Whatever the app of the week is, this kind of stuff is the secret sauce of getting work done without hunting and pecking at files in the Finder.

  1. Some of these features may only be available with purchase of the Powerpack add-on. I don't know. I can't be bothered to pick that apart for people that aren't willing to pay for things. Spotlight is free with the purchase of a thousand dollar computer. 

  2. If there is a single file selected, a preview is automatically displayed on the right side of Alfred with some basic information. 

  3. It removes bad life choices from file names, like dot separators and slashes. 

Older articles

  1. Who Needs Hackers [Link]

    August 18, 2014 by Gabe | [mmd] | ℳ↫

    Sure, the bad guys have all of our passwords. As it goes, they mostly don't need them:

    "We eventually cracked 576,533 or almost 92 percent of the sample within a period of 31 days," Sigler said.

    "Such a short cracking time using a word list from last year ...

  2. Email Is Still the Best Thing [Link]

    August 18, 2014 by Gabe | [mmd] | ℳ↫

    From Alexis Madrigal in the Atlantic:

    That is to say, our inboxes are getting smarter and smarter. Serious tools are being built to help us direct and manage what was once just a chronological flow, which people dammed with inadequate organization systems hoping to survive the flood. (Remember all the ...

  3. Non-Editorial Usage of Critic Markup

    August 17, 2014 by Gabe | [mmd] |

    I use the Critic Markup syntax more than most. Maybe it's because I like the idea of dogfooding things I make. Maybe it's because I made it to perfectly fit my own quirky way of thinking. Whatever it is, you can find the syntax sprinkled throughout almost everything ...

  4. The Lost Pieces of the Avatar Story

    August 15, 2014 by Gabe | [mmd] |

    I'm a pretty big fan of the Avatar animated series.2 I thought the conclusion to the series was great but there were some remaining questions left hanging. So far, it appears there's no interest in continuing the animated saga around Aang.

    There is a series of graphic ...

  5. Dot Notation for Snippet Expansion [Link]

    August 15, 2014 by Gabe | [mmd] | ℳ↫

    I find Zach Holmquist's syntax for TextExpander snippets both logically satisfying and frustratingly prone toward collisions. It's the kind of system that makes me smack my forehead for not coming up with it myself, but then I dig in and realize how terrible it would be in a ...

  6. Some Podcasts that are Great

    August 14, 2014 by Gabe | [mmd] |

    It's that time of year, when summer flings end and we get serious about who we want to hang out with on those long winter nights. The podcast churn is at its highest point of the year for me and I'm looking to replace some shows that have ...

  7. Slack Themes

    August 14, 2014 by Gabe | [mmd] |

    Slack now has themes for the sidebar. If you work with multiple teams (like I do), it's a great visual cue to avoid accidental posts to the wrong one.

    I particularly like the clever implementation because it's kind of nerdy.1

    Open your user preferences in the web ...

  8. Anatomy of a Corporate "Cyberheist" [Link]

    August 13, 2014 by Gabe | [mmd] | ℳ↫

    Brian Krebs writes about Tennessee Electric suing its bank for negligence when hackers funneled off $325,000 from their account. But what I found more interesting is the process by which the money was stolen and that it was distributed to 50 different "mules" around the US. Fascinating and frightening ...

  9. Technical Difficulties with Paper and Pen [Link]

    August 12, 2014 by Gabe | [mmd] | ℳ↫

    We had a special guest on the show to talk about the value of sketching, thinking and working with paper and pen. Bob VanderClay, Erik and I hit on the pros and cons of digital notes and sketches but then it's pretty much just a big show and tell ...