First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.
What I’m trying to do
Create a button in my daily note template, that will open “tomorrow”'s daily note, creating it if necessary.
Things I have tried
The button contains:
templater true
action <%* await tp.user.themorrow(tp) %>
I have tried with and without the *.
The script contains:
const junk = tp.file.create_new(template, newTitle , true , newDir );
return
Which is only executed if the next page does NOT exist.
I have tried every option before the tp.file
I have also removed the return, and used false. so it drops through to the open existing page command.
It produces one of two results: either
a) The script fails to load, giving me no information about where the error is. Or
b) The script is called for the new page, and again for the next day after that, and the next day after that, and continues until the machine is rebooted.
The script has create daily notes all the way until 2055! What a mess.
Note - my daily notes have the structure “8 History/Daily Journals/2025/10/01-October Wed.md”
i.e. location+“/”+tomorrow.format(“YYYY/MM/DD-MMMM ddd”)+“.md”;
Also, as noted in the title. “Trigger templater upon new file creation” is off.
How can I fix this?
Thanks
Ian