Skip to content

How do I automatically move notes to the right folder every day? #1258

Answered by Zachatoo
Pesssimist asked this question in Help
Discussion options

You must be logged in to vote

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:

<% 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}`) %>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Pesssimist
Comment options

Answer selected by Pesssimist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants