Advanced Bash-Scripting Guide. The name says it all.
I wrote up how I’m numbering tasks in OmniFocus, but I’ve now modified the Keyboard Maestro recipe so it’s just a touch faster.
Here’s a screenshot:
I’ve also since created a separate recipe in Keyboard Maestro for each key Project I have in OmniFocus, each with it’s own .txt file that it refers to. This lets me do
and it’ll spit out “(Admin #7)” or if I type
it’ll spit out “(CRM #15)”.
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
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.
Here is a screenshot of the Keyboard Maestro recipe (edit: I’ve since modified this recipe to be a little faster)
This relies on you having a text file named
in your home folder.
The format of this file is just a single line of text as follows: