I wrote a while back about some Day One geekery, and shared the git wrapper I set up for bagging some of my larger commit messages to Day One entries automatically. Then Rob went and asked me if I could do something similar with TaskPaper, logging archived tasks to Day One on the fly. Had to try it.
I built the script using the newer query syntax, and I find it a little more stable than the old project-by-project parsing method (nice work, Jesse). To use it, you just need a TaskPaper document with at least one project and an “Archive:” section, and Day One with the CLI tool installed.
- Using the frontmost document in TaskPaper, it grabs all the @done tasks1 (with or without a date) that aren’t already in the “Archive” project for processing.
- It goes through a few of my common “in-process” tags (@na, @priority, @waiting) and removes them if they exist on a @done task (they’re meaningless after completion).
- Then it looks to see if there’s a @project tag, and if not, it adds one for the project the task was in when it was archived (I think this is default TaskPaper behavior…).
- The full text content of each task (complete with Markdown-style list delimiter and all of the project/date tags you’d want in a log entry) is added to a string.
- Each @done task is then moved to the “Archive” project.
- The name of the parent file and the list of all the tasks you just archived are sent as a single entry to Day One using the
I’m not certain that the end results of using this are superior to logging commit messages. With commit messages I’m talking about what I just did and noting any issues; just being more verbose in general. This technique is a really convenient way to log, though, if you’re already a TaskPaper (and Day One) user, and works perfectly as a supplement to other logging methods.
As you archive your tasks, they get dropped into a calendar view in ready-to-display Markdown format. It’s faster and prettier than to trying to maintain and sort archives of finished tasks in TaskPaper. Given that this is pretty much automatic in my current workflow, I’m just going to let both logging systems churn for a while and see if one or the other isn’t pulling its weight.
The script is thoroughly commented. Probably unnecessarily so for such a short task (I’m pretty sure there’s more comment than code in there). See below for brief installation instructions, and [click here to open it directly in AppleScript Editor][script].
Just copy the script into AppleScript Editor (or click the handy [link][script]) and save it as a compiled script in
~/Library/Scripts/Applications/TaskPaper (creating the folder if it’s not there). If you have the AppleScript menubar item enabled in AppleScript Editor preferences, you’ll be able to access the script from within TaskPaper. It’s really only convenient if you have a hotkey, though. Keyboard Maestro, FastScripts, Launchbar, System Preferences… whatever your poison, just make it easy.
Again, you’ll need to have the
dayone CLI tool linked to
/usr/local/bin/dayone (or modify the path in the script). If you have Day One installed in the standard /Applications directory, just run this in Terminal:
ln -s "/Applications/Day One/Day One.app/Contents/MacOS/dayone" /usr/local/bin/dayone
Thanks for the idea, Rob!
⌘D, but you knew that.↩