link  meta

New Drafts Action: Smart Task in OmniFocus

Posted by Matt Birchler
— 1 min read

There is an action built into Drafts 5 that will add a task to OmniFocus, but I found it a bit lacking. In short, the built in action will add the contents of your note as a description. I always set due dates/times and typically add notes and contexts. Since Drafts couldn’t do that in one go, I rarely used it.

Here’s what I created:

The above draft will create a task called “Post OmniFocus smart add script,” it will be due at 8PM tonight, will have a note “it’s in Drafts, silly,” will be flagged, and will be assigned to my context “Web.”

The script is simple and requires you to follow its rules for it to work right, but I have found it very useful to have so far. Also note that it has not been thoroughly tested, but some quick trials seem to be working for what I throw at it.

You can install the action yourself from the Drafts Action Directory.

Documentation is in the Action Directory, but below are the rules for entering fields. Besides the task name (which must be first) you can enter each line in any order you’d like and can use as many or as few of them as you’d like.

  • “at” or “@“ are for due dates (using OmniFocus’s smart time parsing, so “10am tomorrow” works)
  • “context” or “con” are for contexts
  • “project” or “proj” are for projects
  • “flag” is different, as just writing it on a line by itself will work
  • “note” or “-“ (dash) will create a note
  • All lines that don’t match up with a prefix listed above will be assumed to be a note

This handles all things I need (and a couple I don’t) but feel free to add your own to the mix if you’d like.

Update: I pushed an updte to the script to support capital and lower case first letters. I made the script entirely on an iPad with a keyboard and forgot that iPhone users will have capitals on all lines. Oops!