Why is the API templator not working after opening obsidian?

When I open obsidian and try to connect to templater via my javascript code
const tp = await app.plugins.plugins['templater-obsidian'].templater.current_functions_object;
then I get an error that the variable td is undefined

But if I create any note with templater then after that I can connect to the API via javascript, why is this so ? how to make templater work all the time ?

Create a startup template note, it can be empty, and configure it in the settings of Templater. This would ensure that the Templater engine is started when you use code like you suggested.

1 Like