How do I automatically move notes to the right folder every day? #1258
-
Hi!
I want to write the date in the folder address (/everyday micro/2023/12/ 06_december/) using templater commands, so that a new folder with the date is created every day. But using the following command |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
A good rule of thumb is to never nest command tags You can concatenate the pieces you want like this: <% await tp.file.move("/everyday micro/" + tp.date.now("YYYY") + "/" + tp.date.now("MM") + "/" + tp.date.now("DD_MMMM") + tp.file.title) %> Or, using template literals: <% await tp.file.move(`/everyday micro/${tp.date.now("YYYY")}/${tp.date.now("MM")}/${tp.date.now("DD_MMMM")${tp.file.title}`) %> |
Beta Was this translation helpful? Give feedback.
A good rule of thumb is to never nest command tags
<% %>
. If you're in a command, you can just call the Templater functions.You can concatenate the pieces you want like this:
Or, using template literals: