I have stolen this snippet fragment which lives in every YAML front matter of my templates from templater. It gives the new file a name via a dialog window.
---<%*
let title = tp.file.title
if (title.startsWith("Untitled") || title.startsWith("Unbenannt")) {
title = await tp.system.prompt("[TEMPLATE Neue Notiz] Bitte den gewünschten Dateinamen eingeben:");
await tp.file.rename(title);
tp.file.title = title;
} %>
---
But when I press <Strg-n>
to make a new file and then (when the dialog window shows up) press the ‘escape’ key, this error occures:
Templater Error:
Template parsing error, aborting.
Check console for more information.
How can this error-message be avoided? Somehow the abort has to be intercepted.