Ok I did it.
module.exports = async (params) => {
const {
app,
} = params;
console.log("start here")
console.log("app found " + app);
const templater = app.plugins.plugins["templater-obsidian"].templater;
console.log("templater found " + templater);
const tp = app.plugins.plugins['templater-obsidian'].templater.current_functions_object;
console.log("tp found " + tp);
// prompt for file name input
title = "🪐 " + await tp.system.prompt("Title");
// get path of current file
let filePath = app.workspace.getActiveFile().path;
console.log("filePath " + filePath);
// trim file name from the path
let match = filePath.match(/.*\//);
if(match)
folderPath = match[0] + title;
console.log("folderPath " + folderPath);
// create folder
await app.vault.createFolder(folderPath);
// run note creation with template
const template = tp.file.find_tfile("MOC Template");
console.log("template found " + template);
const folder = app.vault.getAbstractFileByPath(folderPath);
console.log("folder found " + folder);
console.log("title is still " + title);
await tp.file.create_new(template, title, true, folder);
}
Beware of this here, took me an hour to troubleshoot