Automatically trigger template in an existing note

What I’m trying to do

Some of my notes are created as a result of an import from another application (in this particular example: from Omnivore, via the Omnivore Plugin). I want to use templater to modify the frontmatter of these existing notes automatically.

To clarify, I can manually apply a templater template to the frontmatter of an existing note and it will apply the desired changes. But I cannot figure out how I can have this process be run automatically. I am quite open to the kind of trigger (e.g. on startup, after some time passes, after some file event, etc.). Is this something that can be done in templater?

Templater can trigger on file creation (or by manually calling a command), and that’s it. Any other trigger you need to program yourself. It’s possible through javascript to trigger on file change, and possible when the vault opens I guess.

Come to think of it, you might be able to use the Startup template which Templater offers to scan you file structure, discover which files needs updating and update them. Remember to flag the file so you’ll know the next time that it has already been updated.

In other words, I’d reckon it’s a whole lot easier to make yourself a hotkey for the template you want to insert, and trigger that through a hotkey when you come across a file in need of the changes you wanted trigger automatically.

1 Like

Thanks heaps - that is very helpful!