Note is created but Untitled note is opened

I’ve got a driver template that parses out my templates, gives me a menu, and then each one of those opens the new template with the right data and it USED to drop me into the note itself for immediate editing

What I’m trying to do

Have Templater via the Templater: Create Template/.md open a new note with the data from the chosen template and open the created note for editing. It’s currently making the note, and then dropping me into an Untitled Note.
Here’s the code I have in the template. the dailydriver list thing just gives me a full list of things in the template folder, and then as you see makes the note. I am using tp.file.move() in each of the templates.

<%*
let template_list = await tp.user.dailydriver(tp)
let template_choice = await tp.system.suggester(template_list[1], template_list[0])
let folders = ""
let tFile;
switch(template_choice) {
	case "Person Manager Template":
		new Notice("This template should be bound to a hotkey", 3000);
		break;
	default:
		console.log("Inside Daily:" + template_choice)
		folders = await tp.user.dataconfig(tp,template_choice);
		tFile = tp.file.find_tfile("/Templates/" + template_choice);
		await tp.file.create_new(
			template = tFile, 
			filename = template_choice, 
			open_new = true
			);
		break;
}
-%>

Things I have tried

I’ve tried the insert as well and it’s not getting me the behavior I need.

When you instantiate the template like you’ve done, the new file has already been created, and then the template code is executed and you create a new file.

So either you’ll need to switch away from Tenplater: Create …, and into using Templater: Insert …, or you could rename the file you’re already in instead of creating yet another file with create_new.

That was a quick turn around.

For anyone else looking at this…my refactored driver template code here:

<%*
let template_list = await tp.user.dailydriver(tp)
let template_choice = await tp.system.suggester(template_list[1], template_list[0])
let folders = ""
let tFile;
switch(template_choice) {
	case "Person Manager Template":
		new Notice("This template should be bound to a hotkey", 3000);
		break;
	default:
		let baseTemplateName = template_choice.replace(" Template.md", "");
		folders = await tp.user.dataconfig(tp,template_choice);
		tFile = tp.file.find_tfile("/Templates/" + template_choice);
		await tp.file.rename(baseTemplateName + " " + tp.date.now("YYYY-MM-DD"));
		await tp.file.move(folders + baseTemplateName + " " + tp.date.now("YYYY-MM-DD"));
		break;
}
-%>

<%* if (template_choice && template_choice!== "Person Manager Template") { %>
<% await tp.file.include(tp.file.find_tfile("/Templates/" + template_choice)) %>
<%* } %>