Text Tools for Alfred

Ah, text files. Sweet, pure, innocent text files. Always backwards-compatible, never bloated, easy to version and back up. I get nervous when I have to keep data in something other than a text file in Dropbox. Project notes, writing drafts, reference, recipes, and lots of important running lists, all go in ~/Dropbox/PlainText.

To trust my text filing system enough to make it useful, I need to be able to file things away and access previously filed things quickly enough so I don't get distracted from whatever else I'm doing.

Here's an Alfred* workflow I made that lets me do that. It has these features:

  • Create a new text file
    Query: create {folder to create the file in}, followed by the filename in the resulting dialog
  • Search across existing text files
    Query: grep {search query}
  • Append a line to an existing text file
    Query: append {file to append to}, followed by text to append in dialog
  • Prepend a line to an existing text file
    Query: prepend {file to prepend to}, followed by text to append in dialog

Download

Grab it here. Double-click to install.

Setup

I wish there wasn't any setup necessary. Maybe in the next version there won't be. For now, you need to specify which folder you keep your text files in, in the following places: 

  • Double-click the "append" file filter in the workflow pane. Click the Search Scope tab. Delete anything that's in there, and drag the folder where you keep your text files into the list.
  • Repeat for the "prepend" and "create" file filters. 
  • Double-click the "grep" script filter, and replace the path (~/Dropbox/PlainText) with the path to your folder. 

You can of course also replace the keywords append, prepend, create and grep with whatever keywords you like. 

* If you're not familiar with Alfred, check it out here. You will either immediately love it and use it constantly, or not see the point of it at all.