Multiple Lines in Drafts to Multiple Tasks in OmniFocus
One piece missing in my Drafts actions arsenal was the ability to create a single draft with multiple tasks and send them all to OmniFocus via the new URL schemes. This isn't something I use often but there are times when it would be useful and can be the difference between capturing everything and missing a vital thought.
So here we are. I made one. You can install it here.
For those interested, it uses a JavaScript step that breaks each line of the draft apart and reassembles them in taskpaper format. This new string is stored in a new tag that can be used in the URL step.
Here's what the JavaScript looks like:
var text = "";
var tasks = draft.content.split("\n");
for (i in tasks) {
text += encodeURIComponent("- " + tasks[i] + "\n");
};
draft.defineTag("OFTasks", text);
And here's the URL step:
omnifocus:///paste?target=inbox&content=[[OFTasks]]