The problem with displaying the name in the template #1584
-
|
`# Project name: <% tp.file.title %> 📅 <% tp.date.now("dddd, D MMMM YYYY") %>
<%* Project name: Untitled The file name is not displayed in the template. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
<%*
const folder = "01_test";
let name = tp.file.title;
if (!tp.file.folder(true).startsWith(folder)) {
name = await tp.system.prompt("Test name");
if (!name) return;
await tp.file.rename(name);
await tp.file.move(`${folder}/${name}`);
}
%>
# Project name: <% name %>
📅 <% tp.date.now("dddd, D MMMM YYYY") %>
- [ ]
- [x]
---- |
Beta Was this translation helpful? Give feedback.
tp.file.titledoesn't update once Template execution starts. You'll need to reorganize your template to get the new file name first, then reference that instead oftp.file.title. For example: