This is literally the first script I have ever put together in Java script. The idea is taken from the Add to List action in the directory, but instead of picking which one, I wanted to add it to a specific draft everytime, without having to find that draft to update it.
I consider myself an automator, not a programmer. And using URL schemes this would have been super easy for me, but as a learning experience I did it this way.
I’m sure it could be improved though so please tell me how.
const template = ` `; const currentContent = draft.content.trim(); // replace the UUID here with the UUID you want to append too. var d = Draft.find('99D8294B-192D-465F-BBBD-AC29EAFAC6D6'); d.content = d.content + currentContent + template; d.update();