Using Drafts 5 Taskpaper with OmniFocus

I have created an any action group for Drafts 5 which is meant to help you create Taskpaper formatted projects or tasks and then send it all along to OmniFocus afterwards.

The first thing you will want to do is to create a Draft with the Taskpaper format. This is the last but one action in the action group – the reasoning being you’re not likely to need it as often as some of the others! It simply opens a new Drafts with the format set to taskpaper – you can do this yourself by tapping the + icon if you’re in a Draft, and then using the Aa button to set the Syntax Highlighting of the current draft to Taskpaper.

The first action in the group is a tab, this is for iPhone users and iPad users without an external keyboard and it simply inserts a tab wherever the cursor currently is.

The next action is Placeholder, if you have text selected it will wrap the text in «» characters, and if no text is selected it will insert them. This is ideal for dates in templates you will want to update later.

The first Due action takes advantage of the natural language parsing that OmniFocus has available via URL Scheme. Again, if you have text selected it will wrap it in @due(), otherwise that will be inserted empty for you to fill in the brackets.

The Defer, Estimate, Tags, and Context actions work the same way as Due. Tags and context are both available so if you’re on the OmniFocus 3 beta or simply want to prepare your templates to work for both 2 and 3 you can already.

Tags (suggest) offers a list of tags for you to choose from, allows you to choose more than one of them, and inserts them inside @tag(). You will need to edit this script to make it work for you – the "one", "two", "three" is the part that needs changing. Bear in mind that a long list of tags will be annoying to look through most likely. If you want any tags to be pre-selected for you (e.g. you usually add the evening tag to tasks created via Drafts), you can put that into the [] after the tag list.

Autodone asks you if you want the task or project to be automatically completed when the tasks inside of it are completed and inserts @autodone(true) or @autodone(false)as per your choice.

The Repeat Method allows you to choose how the task should repeat, and inserts @repeat-method(fixed), or whichever the relevant choice is.

The Repeat Rule is very simple, but allows you to choose if a task should be repeated every X days, weeks, months, or years.

Parallel works the same way Autodone does, if the project should be parallel (actions able to be worked on at the same time) then @parallel(true) is inserted, if not @parallel(false) appears.

Flagged just inserts @flagged when it is run – which adds a flag to a task.

Due and Defer are here again – but this time with date and time pickers. This allows you to choose an exact date and time when your task or project is due. I’ve used European date formatting, but you can modify that to any other date formatting by replacing the "dd-MM-yyyy hh:mm" (for example in North America you might prefer "MM/dd/yyyy hh:mm").

Estimate makes another appearance, this time it asks you to choose how many minutes, hours, days or weeks something will take and fills in the @estimate() for you.

The final action in this set is Taskpaper to OF. This will ask you where you want to save your Draft (as a new project, a new project in a folder, as tasks in a specifc project, or the inbox), go through any «placeholders» you have and help you replace them (important cat is always going to be replaced with whatever you tell the script when it asks you about it, so make sure you to use unique placeholders where necessary!), and then send everything off to OmniFocus. Once you return if it did have placeholders to replace it offers to make a new Draft, update your current Draft, or do nothing.

This action group is set up as a keyboard group, which should make quick entry easier. You can get the action group from the Draft 5 Action Directory: OF Taskpaper

10 thoughts on “Using Drafts 5 Taskpaper with OmniFocus

love this set of drafts actions — use it all the time! will say something odd has happened with the due date one recently. for some reason it adds due date in this format: dd-mm-yy instead of mm-dd-yy, no matter how many times i tweak the code. anyone else had similar issues?

Thanks for this great script! One question:

I’d like to maintain different project templates (with placeholders) as different drafts in Drafts, and give each template a title, for clean organization. How can I modify the “Taskpaper to OF” action to ignore the draft’s title when outputting?

(I’m aware of [[draft]]/[[title]]/[[body]] differentiation in basic Drafts actions, but not sure how that might be used with your script, if at all. I’m a novice when it comes to scripting!)

Is there a simple solution to this that I’m overlooking?

It took me a while to find the answer to this. Replace line 50 of the Taskpaper to OF action with `var draftsContent = draft.processTemplate(“[[body]]”);`.

I am trying to @due(01/23/2021) actions to work but when I send to OF, the due date I assigned doesn’t work? Am I assuming it should create a due date.

Further, using @tag(test) the test tag is not created either

I’ve just started using this, and I’m already finding it incredibly helpful. I have a particular project that I need to create often, and I always want the projects to go into a single folder, so I tweaked the Send to OF (Project) action a little so that I could include a note that specifies the target folder – it just uses the value to pre-populate the form field, so there is still the option to override it when sending a project to OmniFocus.

The template looks like this:

Interview «candidate» @autodone(true) @parallel(false):
– Review CV @due(«day» 9am)
– Review feedback @due(«day» 9am)
– Conduct interview @due(«day» 11am)
– Send feedback to HR @due(«day» 4pm)

The modified beginning of the action script is:

// See online documentation for examples

const baseURL = “omnifocus:///paste”;
let defFolder = “”;
let defFolderMatch = editor.getText().match(/^folder\((.*?)\)/m);
if (defFolderMatch) {
defFolder = defFolderMatch[1];

let p2 = Prompt.create()
p2.addTextField(“folderName”, “Folder Name”, defFolder);


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.