What I’m trying to do
I am trying to make the following code work (the code is in a template):
<%*
tp.file.include("[[NOTE]]")
%>
For clarifacation the command works perfectly well for me when I do it in 1 line i.e.
<% tp.file.include("[[NOTE]]") %>
does what it is supposed to do and includes NOTE when I create a new note with the template. I really have know idea why it doesn’t work in the multiline version or how to fix it. But I need it in a multi line envirment since I want to include a note based on what day of the week it is and for that I need a variable that takes a value based on the current date and I think that can only work with multiple lines. Specifically I would like something like this to work:
<%*
let day = tp.date.now("dddd");
day = day.toLowerCase();
tp.file.include("[[${day}]]")
%>
Things I have tried
I have only really tried to modify the code a bit. But since I am not familar with JavaScript or the Templater Plugin that kind of let nowhere. I also asked ChatGPT but that didn’t help It would be really cool if someone shares a solutions for this since it’s driving me kind of insane.