Converting an Omnifocus Taskpaper Markdown parsing Draft to work for Things3

Hi MPU community,

I’m a bit stuck and I was wondering whether anyone here could offer some assistance.
I used to use Omnifocus and am now slowly transitioning back to Things3 but I have a draft that I use quite often which I managed to get working for Omnifocus but I have no idea how to do it for Things3.

I would be incredibly grateful if anyone has any input for how to adapt it for Things3 compatibility.

It is written in javascript and basically parses my meeting notes template in drafts and picks out all markdown tasks and then copies them into Omnifocus (I think in taskpaper format) so in the following document it would pull out Task 1 and add the tag “Meeting Action” to it:

# Meeting Notes

## Actions
- [ ] Task 1

## Content
Bla bla bla 

So essentially if anyone knows a quick fix for adapting it or would be willing to help me out real quick I would be infinitely grateful. I don’t really know javascript too well but if anyone can help me out I’m willing to tip for your time as this is really invaluable to my workflow.

This is the current code I’m using and a screenshot of my usage:

let taskpaper = '';
draft.content.split("\n").forEach(function(line){
	if (line.startsWith('- [ ]')) {
		taskpaper += "Meeting Task: " + line.replace('[ ]', '') + " @tags(Meeting Action 🎙)\n";
	}
});

const baseURL = "omnifocus://x-callback-url/paste";
let cb = CallbackURL.create();
cb.baseURL = baseURL;
cb.addParameter("content", taskpaper.trim());
cb.open();

Answered in the Drafts forums