My ‘create a new note’ default template suggests a few templates to use when creating the note, and it works great. I want to add one last option: if “other” is selected, then open the “Browse for Template” template which opens my Templates folder (incl subfolders) and lets me choose the template to use in this case.
The problem is that it just links to the selected template rather than applying it. Of course that is exactly what I’m telling it to do; but I don’t know how to tell it to “go and execute the selected template”.
I’ve tried various iterations of <% tp.file.include("[[<% selectedFile.path %>]]")%> and <% tR+= tp.file.include("[[<% selectedFile.path %>]]")%>
My 'Browse for Template' template code
<%*
const folderPath = "Admin/Templates";
const files = tp.app.vault.getMarkdownFiles()
.filter(file => file.path.startsWith(folderPath));
const selectedFile = await tp.system.suggester(file => file.basename, files);
%>
[[<% selectedFile.path %>]]
