Created
November 20, 2021 13:41
-
-
Save maique/aa59a233efda7fc9fdaf88391a70b0c3 to your computer and use it in GitHub Desktop.
Append to Note
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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