Templater dynamic string commands?

Things I have tried

I have tried to change the string of where something goes after it has been created and I can’t figure out how to put the string into the Templater command.

Here I am trying to auto name a file based on next weeks Monday. I just need to be able to include the Date in the name of the file.
<% await tp.file.create_new(“G6_Weekly”, “G6 Lesson plans for the Week of” + next_week.format(ISO_8601_SHORT_FMT), false, “Hikmah School/6th Grade/G6 Lesson Plans/G6 Plan of the Week/G6 W LP6/”) %>

Here I am trying to move my Daily note into it’s month folder so that I can keep down clutter and I don’t have to move the files manually and it automatically updates to the new folder every month.
<% await tp.file.move(“Day Planners/” + tp.date.now(“YYYY-MM”)+ " Reflections") %>

What I’m trying to do

These prompts are backwards<<

<% await tp.file.create_new(“G6_Weekly”, “G6 Lesson plans for the Week of” + next_week.format(ISO_8601_SHORT_FMT), false, “Hikmah School/6th Grade/G6 Lesson Plans/G6 Plan of the Week/G6 W LP6/”) %>

<% await tp.file.move(“Day Planners/” + tp.date.now(“YYYY-MM”)+ " Reflections") %>

I figured it out.

<%*
var mydate = tp.date.now(“YYYY - MM”);
%>

<% await tp.file.move(“Day Planners/”+ mydate + “/” + tp.file.title) %>
<% await tp.file.rename(tp.date.now(“YYYY-MM-DD”) + " Reflections") %>

You have to add that backslash after the date modifier.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.