Replies: 1 comment
-
I would do something like this. Replace the <%*
const path = "path/to/note";
const file = await tp.file.find_tfile(path);
if (!file) {
const template = tp.file.find_tfile("Templates/prattatx");
await tp.file.create_new(template, path, true);
} else {
app.workspace.getLeaf(false).openFile(file);
}
-%> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the Template Hotkeys section of Templater, I set a hotkey to launch a template. If that template file already exists, I get a "Template parsing error, aborting. Destination file already exists".
My ideal use case: Creating a daily journal. I click the hot key to write morning reflection. I may or may not leave that file open in my workspace, and I may do it mobile or desktop. I go about my day. In the evening, I reflect on the day. I press the hotkey, and it shifts to or re-opens the same file.
Beta Was this translation helpful? Give feedback.
All reactions