Working with Files in Alfred

Page content

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. ↩︎