As the 3 step process, it works fine but the I figured I should be able to use Templater’s “Create new file from template” command and the Trigger Templater on new file creation setting to get it done in one command.
No go. Syntax error.
I’ve been just cutting and pasting stuff from the web as I know nothing of Java/TypeScript.
Thank you! I didn’t know how to show the console. When I did and tested, I believe the problem was that there was already a file with that name in the directory.
I seen other solutions that break it down into steps like this but then people commented that it was better to make it all one line. I like this solution of your’s as it’s easier for me to understand what’s going on.
For future reference for those that may come across this post, I did not select a solution for this problem, because the problem (getting a syntax error when when running the Templater command “Templater: Create new note with template” was that I had successfully created a new note the first time but then forgot to delete it, made some changes, tested and got an error because I already had a file with the same name. I didn’t know how to access the developer console which was prompted by @stef.rausch in this thread and clarified for Mac by @JonathanBuchh in this thread.
In a side win, @AlanG helped me fix up template to do what I wanted it to from the start!