Create file after choosing a folder

This is a templater script for creating a file after choosing a folder
(make sure to put in your template folder and invoke it through open insert templater modal command)

<%*
const folders = this.app.vault.getAllLoadedFiles().filter(i => i.children).map(folder => folder.path);
const folderChoicePath = await tp.system.suggester(folders, folders);
const folder = app.vault.getAbstractFileByPath(folderChoicePath)
await tp.file.create_new("","",true,folder).basename
_%>
3 Likes