Logging with Day One and Alfred

Yesterday, Brett Terpstra posted a fantastic little script to leverage Day One's built-in CLI (command line interface, more information available here) to create new journal entries from the Terminal or an app launcher. Brett has posted instructions on how to use Launchbar with the script, or skip the app launcher part altogether and go with the Mac's Terminal instead:

Day One already has a quick entry palette in the menubar. It also has a command line interface (/usr/local/bin/dayone)1 which provides some geeky options (try dayone in Terminal) and the flexibility needed to replace my current logging system. You can create entries quickly with either method, but I wanted just a little bit more out of it. I built a quick script which allows a basic syntax for starring entries and defining dates (using natural language) inline in the entry itself. It can be used from the command line, from LaunchBar (or similar) and can be incorporated into just about any scriptable workflow.

I wanted to make the script work with Alfred, my app launcher and navigation tool of choice, and it turns out the effort to modify Brett's script is equal to zero. I simply replaced "on handle_string(message)" with "on alfred_script(q)" and "end handle_string" with "end alfred_script" to make it work in Alfred. Obviously, you'll need to fill in the path to your script after you've followed Brett's instructions.

The three Day One entries above were created (and starred) using Alfred.

Before you create a new Applescript extension in Alfred, don't forget to download Brett's script and make it executable in your desired location, and create a symlink for Day One's CLI (Show Package Contents on Day One, then navigate to Contents/MacOS/dayone - that's the CLI you have to symlink) in your usr/local/bin/ directory.

You can check out Brett's post here, and catch up on our coverage for the latest version of the app, Day One 1.5 (Mac and iOS).