Replace templates in the active file for alla files in a folder/vault

Hi Obsidianers!

What I’m trying to do

I’d like to invoke “Templater: Replace templates in the active file” for all files in a folder/vault, in batch mode.
Any idea?

Many thanks in advance.

What do you believe the replace templates command will do?

It’ll not change the template that was used to create the note, and recreate the note with the new template if that’s what you believe it to do.

This command is used if you write some Templater code into the current document, and replace that with the corresponding text.

I’ve got 6K+ files with names like “2024-05-11 @ 08.15→11.15”, with YAML headers containing

date: <% tp.file.title.substring(0, 10) %>
time_start: <% tp.file.title.substring(13, 18).replace(".",":") %>
time_end: <% tp.file.title.substring(19, 25).replace(".",":") %>

Invoking Templater: Replace templates in the active file, the YAML header becomes

date: 2024-05-11
time_start: 08:15
time_end: 11:15

I’d simply like to avoid doing it one file at a time…

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