I’ve created a “choice folder” that’s part of my automation process. If a file goes to this folder, templater make a prompt that allows me to choose between differents options (in that case author, personnality, contact in French) which will define in which folder I want to move the file.
According to the choice, Templater will move the file in the right folder.
Each of those folder are set in a way that they have their own template and templater will apply those templates if a file is created inside them.
My script works well to make the choice and move the file in the right location but once this is done, templater does not apply the template related with the folder of destination. I think it is easily fixable, but I don’t find the command to tell templater “hey ! Just consider it’s like a new file”
NB : My note will be blank so I don’t care if it’s content is erased
How about using a Prompt Template with <%-tp.file.include("[[template_name]]")-%> lines
in an if - else if - else conditional trio? This way you can default back to a template that you can use for anything else.
<%-* let filetype = await tp.system.suggester(["Auteur", "Contact", "Personnalité"], ["Auteur", "Contact", "Personnalité"], false, "Which template do you want to use?") -%>
<%-* if (filetype === "Auteur") { -%>
<%-tp.file.include("[[Templatename1]]")-%>
<%-* } else if (filetype === "Contact") { -%>
<%-tp.file.include("[[Templatename2]]")-%>
<%-* } else if (filetype === "Personnalité") { -%>
<%-tp.file.include("[[Templatename3]]")-%>
<%-* } else { -%>
<%-tp.file.include("[[DefaultTemplateName]]")-%>
<%-* } -%>
But you could incorporate the template in a meta templater.
I set it up using this guide many moons ago:
I had this idea by looking at this video (meta template). The problem is that I find the meta template not flexible enough and not easy to install for people who struggle with code. So if I have to modify the code each time I want to change template it’s not the best for me. That why I want to use the "automatic template in a folder* of templater.
I prefer to use auto note mover and quick add to organize my notes.
In a way, the issue I’ve encounter is not that problematic but I don’t understand why it’s isn’t working and it can be a problem for me for futur projects
@Mathunter if you’re struggling to get things working by moving notes into folders, you might find it easier to do it the other way around - and have the new note be automatically created in the right folder depending on the template.
You put all your different types of new-note templates in a single folder, and the script will present them to you as a list and you just choose one and start working:
Each type of template can optionally specify the folder it will use to make the new note, using a Property in the template.
This way it doesn’t require any programming skills at all - all you need to do is add your different types of templates to a folder, and you’re ready to go.
It doesn’t take a programmer to make changes to code already working. And one can easily buff up the meta templater contents to dozens of different templates. All one needs to be mindful is of putting the new items in the proper places.
But I don’t force a pudding that doesn’t taste good.