Numbering tasks in OmniFocus 2 for Mac OS X

I’m using OmniFocus 2 on my MacBook Pro and wanting to ‘number’ tasks because at the end of each week, I print a PDF of the tasks completed and outstanding for a particular client. Task numbers make it much easier for the client to reconcile the work I’ve done with the lists they use.

The problem is that OmniFocus doesn’t have a ‘task number’ function.

Keyboard Maestro and a shell script to the rescue. This allows me to get the next sequential task number. Now all I do is type

,,task

and it expands out to the next available task number.

In a nutshell I use the shell script to get a variable from a text file (which is the last task number I used), and increment it. Keyboard Maestro is wrapped around this to both trigger it and make it look pretty.

The shell script itself is quite basic, any improvements you can suggest, please do.