What I’m trying to do
I have a templater template which uses (among other things) a couple of lines pulling a list of files from the vault as a selection (which the user then selects etc.)
My problem is trying to sort the list which gets produced as the selection to choose from. I’ve tried using bits of code looked up on the 'net, but none work. So please help! I simply want an alphabetical list…
This is the code (I’ve put the two lines using suggester in bold):
<%*
const dv = this.app.plugins.plugins[“dataview”].api
let Project = (await tp.system.suggester((item) => item.basename, app.vault.getMarkdownFiles().filter(file => file.name.startsWith("1 ")), false, “Please select Project…”)).basename
let shortName = Project.slice(2)
let qcFileName = (await tp.system.prompt(“Note Title”))
let fileDate = (await tp.system.prompt(“Date”))
let fileTime = (await tp.system.prompt(“Time (HHmm)”))
let org = (await tp.system.suggester((item) => item.basename, app.vault.getMarkdownFiles().filter(p => dv.page(p.path).file.etags.includes(“#Org”)), false, “Please select Organisation…”)).basename
titleName = fileDate + " " + fileTime + " " + " - " + qcFileName
await tp.file.rename(titleName)
if (Project == “1 NONE”)
await tp.file.move(“/0400 Organisations/” + org + “/Notes/” + titleName)
else
await tp.file.move(“/0200 Projects/” + shortName + “/Notes/” + titleName)
-%>
Thanks in advance