This is an example of a Templater template.
---
tags:
<%*
let title = tp.file.title
if (title.startsWith("Untitled")) {
title = await tp.system.prompt("Title");
await tp.file.rename(title);
}
tR += "---"
%>
Title: <% tp.file.title %>
Date: [[<% tp.date.now("YYYY-MM-DD") %>]]
I have used this for months without problems. Obsidian crashed the yesterday, so I decided to delete the app and reinstall it.
All my notes are fine but some of the settings needed to be redone, such as hotkeys and file preferences.
When I use the sample template above:
- I am prompted for the file title twice
- Templater inserts the right date in the file
- Templater does not insert either of the titles from the prompts in point (1) above; it just names the file
Untitled
Have uninstalled Templater and tried the same code in a test vault. Can’t get it to work.
I also have Folder Templates
assigned to different templates. None of those templates work properly, showing the same errors as above but also not putting the new notes in the folders they should appear in.
Thanks in advance for any advice.