Renaming daily notes template with Templater

Hey everyone - I am fairly new to Obsidian, and would love to start a “journal” section. However, I am unlucky in being a somewhat of a coding newbie who has spent hours getting Templater to do what I want it to :slight_smile:

Things I have tried

My (relevant) setup:

  • Obsidian 1.0.3
  • Templater 1.16.0

I have created a “Templates” folder and assigned my “Daily notes” template to a “Journal” folder, which works fine. I have also managed an automatically created YAML header with the help of these two tutorials: 1, 2

I have tried multiple variants of tp.file.rename tp.file.move, but it is likely best to describe below what I would want to achieve rather than to bias potential respondents with what may be the wrong way to go in the first place :slight_smile:

What I’m trying to do

I would like to achieve three things with Templater commands:

  1. Rename the file with the current date in the format of “YYYY-MM-DD” (e.g., today would be 2022-11-27 - European style).
  2. Move the file into the “Journal” folder. Optionally: create a year folder (“2022”) within “Journal” and move the note here.
  3. Create a separate title within the note copying the file name.

Any help would be much appreciated!

I managed to solve the problem myself, but quickly wanted to update for anybody potentially searching for a similar solution:

Created: <%"YYYY-MM-DD") %>
Last modified: <% tp.file.last_modified_date("YYYY-MM-DD") %>

#  <%"YYYY-MM-DD, dddd",0) %>
<% tp.file.rename("YYYY-MM-DD",0)) %>

It is not quite as sophisticated as I wanted it, but it does the trick: instead of pulling the file title with tp.file.title, I opted for a modification to which works the same.
The last command then modifies the file name to the current date.

Next step - my desired optimal solution :slight_smile:

Why don’t you apply what you did in the other post, and move it into the journal folder?

Not sure what you mean with that last title part, but storing the title like you did there, would enable its use as a heading, if that is what you mean.

Thanks for the suggestion - first I need to spend some time to understand the syntax a little better, and then tinker around with it. As a temporary fix I added

title: <%"YYYY-MM-DD") %>

and modified the “header” to pull from that title:

# <%* tR += title %>

… but happy with the progress made today - thanks again for your help!

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