Regarding the workflow, you could definitely start these notes in Drafts. The actions, scripting support and templating functionality is a super powerful combo and can easily automate what you need. I love the idea of starting all text interactions (within reason) in Drafts, and then take it from there with actions. That seems to be the philosophy behind the app, and it works for me, so I would wholeheartedly recommend trying it out.
You might want to create the action to insert the ID anyways, in case you need to process already existing notes, right?
const content = draft.content; // grabs the text of the current draft in the editor
// One common option is to split the text by lines into an array
let lines = content.split(“\n”);
const title = lines.shift(); // removes the first line from array and assigns it to the title variable
const body = lines.join(“\n”); // turns the array back into a text string with line changes
// Now create the ID
const id = draft.processTemplate([[date|%Y%m%d%H%M]]);
//Join the title with the id and the body of the text
const newContent = title + “\n” + id + “\n” + body; // \n is the newline character
// paste the new text (will replace the old draft)
draft.content = newContent;
draft.update(); // saves the changes
This should do the trick. If you don’t want to replace the old draft, but rather make a new one, add this line in the beginning
const d = Draft.create() and exchange all instances of the word ‘draft’ in the script with ‘d’ except in the first line(!).