Things I have tried
<%*
let title = tp.file.title
if (title.startsWith("Untitled")) {
tp.file.rename("DreamLog");
}
tR += "---"
%>
<% tp.file.cursor() %>
What I’m trying to do
I would like to add the date into the title using templater’s function, but it wont work.
<%*
let title = tp.file.title
if (title.startsWith("Untitled")) {
tp.file.rename("DreamLog"<%tp.date.now("ddd MMM-DD-YYYY")%>);
}
tR += "---"
%>
<% tp.file.cursor() %>
My goal here is so that anytime i create a new note inside of my “Dream” templater automatically renames it to “Dream Log December 23 2022” (today’s date)
It seems that adding another “<%” into the code breaks it but im not sure how to fix it.
What is the solution and where would i be able to find this kind of solution next I have to write some code like this?