Here is a Drafts-only approach using javascript and the OmniFocus URL scheme.
https://drafts4-actions.agiletortoise.com/a/1s3
To use, your drafts note should be structured like so:
Project Name
Defer Date
Due Date
Task 1
Task 2
Task 3
etc…
For this example, I have hard-coded the script to automatically add a flag to all tasks. Also, context is omitted since it is assumed that the context will inherit the properties of the project. Be sure not skip any of the first three lines - otherwise, the code won’t work.
Also, here is the javascript code for anyone who is interested in learning or adapting for their own use.
// Project
// Defer Date
// Due Date
// Task List
// Context assigned automatically with project
// Flag automatically assigned
var content = draft.content;
var lines = content.split(/\r\n|\r|\n/g);
var project = lines[0];
var deferdate = lines[1];
var duedate = lines[2];
var tasklist = “”;
for (var i=0; i< lines.length; i++) {
if (i>2 && lines[i]!= “”) {
tasklist = tasklist.concat("-",lines[i]," @flagged @due(",duedate,") @defer(",deferdate,")","\n");
};
}
project = encodeURI(project);
tasklist = encodeURI(tasklist);
var fullUrl = “”;
fullUrl = fullUrl.concat(“omnifocus://x-callback-url/paste?target=/task/”,project,"&content=",tasklist,"&x-success=drafts4:///");
draft.defineTag(“full_url”, fullUrl);