Code Block + Cursor Position Problem

What I’m trying to do

I want the following:

  1. Create Note with Template
  2. Get Asked for Meeting Participants
  3. Write current date + Meeting Participants in FileName
  4. Write Current Week as property
  5. Position Cursor in the ##Notes Section

Things I have tried

This is my template:

<%*

const today = tp.date.now(“DD.MM.”);

const kw = tp.date.now(“W”);

const title = await tp.system.prompt(“Teilnehmer?”);

await tp.file.rename(${today} – ${title});
tR += `—

KW: ${kw}


Notes:

`;

%>

<%tp.file.cursor()%>

<%*
tR += `

To-Dos:

`;

%>

I have tried thousands of options. It seems that the string “<%tp.file.cursor()%>” is incompatible with the tR variable code block. So I tried do split the tR into two parts. How can my code block be executed and afterwards the cursor be set?

THANKS <3

Do you have “Automatic jump to cursor” enabled?

If so, what is the current behavior you are experiencing? Here is what I experience:

  1. Execute “Templater: Create new note from template” command.
  2. I am prompted for participants, I enter data and hit Enter.
  3. Cursor is focused in tab title bar (or the inline title, if enabled), as Obsidian does for all newly created notes when the tab title bar or inline title is enabled under appearance settings.
  4. I hit tab, and cursor is where <%tp.file.cursor()%> was in template.