Drafts to OmniFocus

actions

#1

Hi everyone

I’m looking for a Drafts action that will take a list in Drafts and send it as separate actions to OmniFocus.

A list like this:

  • Buy milk
  • Sweep roof
  • Walk dog
  • Brush teeth

Anyone know if this is possible?

Thanks :blush:


#2

A quick look in the Action Directory for “OmniFocus” gave this:

https://actions.getdrafts.com/a/1E6

Send each line of the draft to OmniFocus as a new task. Each task must be confirmed in OmniFocus.


#3

I use the List in Reminders action and have OF set up to monitor a specific Reminders list.

This can run without needing to open OF for each task.


#4

Here’s an action that just drops the whole note into the Inbox with no confirmation needed:

https://actions.getdrafts.com/a/1QO

(By adding a parameter, autosave, set to true, to the action above you can eliminate the need to confirm each task as well.)


#5

On this topic, I found this Action that seems really useful, but it has a bug wherein a dash anywhere on the line will cause the line to be converted into a task, which I don’t think is the intended behavior. Based on its description, it’s only supposed to send lines that begin with a dash to OmniFocus, but any line with a dash gets sent (and the dash gets removed.)

https://actions.getdrafts.com/a/1Pw

For example, this list:

Meeting Notes
Attendees: Bill, Susan, John
- Put together design mockup
- Email client
Email should include billing info
Client address is 512 Wilkes-Barre Road

will be turned into the following OmniFocus tasks:

Put together design mockup
Email client
Client address is 512 WilkesBarre Road

That last one should not be a task.

I am not a coder. Anyone able to help fix that bug?


#6

Hi. Yes that is my (admittedly somewhat repurposed) Action.

It could be fixed by changing the Task prefix to a character or string far less likely to cause interference. I personally opted for “-” as it’s a nice visual identifier that’s quick to enter. I’ve seen one with “OmniFocus:” or “OF:” used but that’s a little bit to fiddly for me when typing notes quickly in a meeting.

The section you need to change is:

const taskPrefix = “-”;

Change the “-” to another character. Maybe “+” or “~” ?


#7

You could also use the JavaScript function startsWith :wink:


#8

Thanks. That fixes this bug. Forgive my lack of JavaScript knowledge! I actually took and repurposed it from something @clarke posted to the community.

Sorry I haven’t yet credited @clarke So thanks!

This action is updated.

https://actions.getdrafts.com/a/1Pw


#9

I suspected that might be the case! Repurposing existing actions is a great way to learn :slight_smile: