Skip to content

Instantly share code, notes, and snippets.

@maique
Created November 20, 2021 13:41
Show Gist options
  • Save maique/aa59a233efda7fc9fdaf88391a70b0c3 to your computer and use it in GitHub Desktop.
Save maique/aa59a233efda7fc9fdaf88391a70b0c3 to your computer and use it in GitHub Desktop.
Append to Note
//Set this to be the UUID of the draft you wish to append to.
let specificDraftUUID = "ID Goes Here";
//Set this to be the separator between appends
let separator = "\n\n---\n";
let date = `${strftime(new Date(), "%d %B %Y %H:%M")}\n\n`;
//Find the draft to append to
let specificDraft = Draft.find(specificDraftUUID);
//Append the separator followed by the current draft contents to the draft to be updated
specificDraft.content = specificDraft.content + separator + date + draft.content;
specificDraft.update();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment