New Properties and templater prompts and commands?

Just a small/final update from my side. With your input I managed to get my template to ask for title and two tags (category and subject) and place the information correct. Great fun fiddling with it to understand how things work.

I leave the code here, in case other want to so something similar.

<%* 
let title = tp.file.title 
let sSubject = ""
let sCategory = ""

if (title.startsWith("Untitled")) { 
  title = await tp.system.prompt("Title"); 
} await tp.file.rename(title);

sCategory = await tp.system.prompt("Category");
sSubject = await tp.system.prompt("Subject");

setTimeout(() => {
  app.fileManager.processFrontMatter(tp.config.target_file, frontmatter => {
  frontmatter["category"] = sCategory;
  frontmatter["subject"] = sSubject;
  })
}, 200)

-%>
10 Likes