Technology: Todo.txt, PowerShell, and OneNote

July 27, 2007

So this is pretty geeky of me. I read the description of people who keep their list of things to do in just a plain text file, and then use computer scripts to process it. You can read more here: http://todotxt.com/. To quote the website:

**Plain text** is software and operating system agnostic. It's searchable, portable, lightweight and easily manipulated. It's unstructured. It works when someone else's web server is down or your Outlook .PST file is corrupt. Since it's been around since the dawn of computing, it's safe to say it's completely future-proof. There's no exporting and importing, no databases or tags or flags or stars or prioritizing or [Insert company name here]-induced rules on what you can and can't do with it. > > **Todo.txt** is a flat text file that contains one task per line, each optionally associated with a context, project and priority for slicing, dicing and sorting. > >

The website then refers readers to a shell script that manipulates the contents of todo.txt (you know, when you just can’t fire up emacs). Well, I figured, why should the Unix users have all of the fun? So for us Windows users, I wrote a series of PowerShell scripts that can be used to manipulate a todo.txt file. You can find the scripts here: TodoTxtPowerShell.zip. These scripts are provided under the Microsoft Community License. In the package, the file about_TodoTxt.help.txt gives more information about the scripts.

While these scripts are certainly useful, if you’re going to keep all your todo items in a text file, I don’t think the scripts make things any easier than just editing the file in Notepad. These scripts are probably more useful as an example of how to use PowerShell for text processing. The scripts are pretty straightforward and make reasonable sample code for PowerShell. When I have more time, I might dissect the scripts in this blog.

One bonus of moving to a PowerShell world for scripting is that I’m not confined to storing these lines of text in a text file. Thanks to the OneNote PowerShell Provider, my PowerShell scripts can manipulate text on OneNote pages as well as in text files. So if you live out of OneNote and want to bring the simplicity of a todo.txt-style todo list to the place you keep the rest of your notes, well, now you have a set of scripts that can help you manipulate those todo items.

As an aside, the OneNote integration came (mostly) for free, and I think it really shows off the long-term potential that PowerShell’s provider model brings. It becomes quite easy to stitch data together from multiple sources.