Quick open files of a certain type
I’m not spending £19 an Alfred for just this one purpose, but for its seemingly endless uses that improve productivity. In this example, I’ll create a shortcut to open Xcode projects and workspaces.
Requirements
- A utility application called Alfred
- Purchasing the Powerpack for £19
Setup
- Open Alfred Preferences
- Click on Workflows
- Click on the button at the bottom of the sidebar
- Choose Templates > Files and Apps > File filter from keyword and open
- Give it a name like “Open Xcode Project” and click OK
- Double-click on File Filter
- Enter “x” in the keyword field and uncheck “with space” (unchecked, this means the space is optional)
- In the File Types field, click the button and navigate to an xcodeproj file
- Optionally, do the same with an xcworkspace file
Optionally, you can click on the Search Scope tab and restrict the search to one or more directories.
Now, bring up Alfred
Type “xfoo” or “x foo” where “foo” is the name of a project and note it’s the first result to display. Just type “x<space>” and a space and see a list of Xcode projects
Since each search type is constrained to a file type and hierarchy, it’s extremely fast and every result is the type of item you want.
Extra credit
If you also use workspaces, you can set up a separate workflow triggered off another key like “w” with a different file type and location. Note that this can be applied to any file type and any location, making it superior to Spotlight for targeted searches.