Hi Automator gang,
Iām having a bit of difficulty converting a draft script I used to use to parse through my meeting notes and convert any task that is shown in drafts as a markdown task into an Omnifocus task. I have now switched to Things3 and am not sure how to automate this. I use javascript as a drafts action as shown in the screenshot.
Does anyone have any tips for how I might be able to achieve this?
Thanks in advance
The kind of document id like to parse looks a little bit something like this:
Meeting Notes
Tasks
- [] Task 1
Etc.
This is the code Iām currently using:
// https://docs.getdrafts.com/docs/actions/scripting
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(); ```