How to automate "Replace templates in the active file" ? #906
-
Hi, I am new to Templater so maybe this is documented but I could not find it. I added a bunch of Templater templates to my vault documents using a shell script with a bunch of Is there a way to automate this process? Something like "Replace templates in all files in vault" ? I looked at possibly using the Obsidian URI to construct a command line that would do this but I do not believe the URI command line interface can do anything more than open a document, not send it a Hotkey. Maybe this is easy and I just do not know Templater well enough? Or maybe it is just not a supported workflow? Any help greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You may want to redo some of this. Templater has a setting to resolve templates on new file creation but I suspect you have it turned off. Once you turn it on, try moving the files outside the vault and then move them back in. If that doesn't work, try recreating them via the script. If that still doesn't work, write a script to generate them in Templater itself and that should give you more than enough flexibility. |
Beta Was this translation helpful? Give feedback.
-
I was able to successfully resolve all Templater templates by copying in the documents one at a time to a new location in the vault, sleeping a bit between copies. This is an ok one-time workaround for large bulk template ressolutions (for templates added in this manner, using text processing utilities outside of Obsidian/Templater). However, it appears there may be some kind of race condition or other issue interfering with the processing of new notes in either Obsidian or Templater. Why is the sleep necessary? I am not yet familiar with the Obsidian plugin architecture so I do not have a good guess nor do I have a simple minimal test case that reproduces this problem. Ha! Not much help. But, generally, I am satisfied with this procedure. Large bulk template resolution is hopefully a rare occurrence and the sleep only means I have to work on something else while that runs. Templater is a really great plugin. Thanks! |
Beta Was this translation helpful? Give feedback.
You may want to redo some of this. Templater has a setting to resolve templates on new file creation but I suspect you have it turned off. Once you turn it on, try moving the files outside the vault and then move them back in. If that doesn't work, try recreating them via the script. If that still doesn't work, write a script to generate them in Templater itself and that should give you more than enough flexibility.