Closed DryIce1 closed 5 months ago
You can do that already @DryIce1. Create a template based on the following code block and then tie the inserting of the template to a button! :)
<%*
const prompt = await tp.system.prompt("Title:")
const title = await prompt
await tp.file.rename(title)
tR += "# " + title
%>
---
#tasks #inbox
Completed::
Project:: [[<%tp.file.cursor(1)%>]]
Status:: #active
Priority::
Date Created:: <% tp.file.creation_date("dddd, MMMM D, YYYY @ HH:MM") %>
Due Date::
Defer Date::
Recur Length::
Hi @MartynKeigher, thanks for the snippet - it does what it is supposed to do perfectly! And I have added the tp.file.include
function so that my Action Items Template can remain unaltered.
For any non-tech people who want to do something similar, here is my current set up.
Button
button
name New Action Item
type note(Title, split) template
action Templater - rename file title and include Action Item Template
templater true
color blue
Template 1 - rename file title and include Action Item Template
<%*const prompt = await tp.system.prompt("Title:")
const title = await prompt
await tp.file.rename(title)%>
<%-tp.file.include("[[Action Items Template]]")%>
Template 2 - tp.file.include - Action Items Template
#inbox
---
- *Back Matter*
- **Date Added**:: 2021-10-28 15:20
- **Do Date**::
- **Due Date**::
- **Done**::
- **Recur Length**::
- **Priority**:: #✅/P
- **Status**:: #✅/S/1_Active
- **Date Added**:: <%-tp.file.include("[[Timestamp]]")%>
- **Person**::
- **URL**::
Problem
Expected solution
for example, my current use case, where I would want to manually rename
New Note
:I hope this makes sense and is useful for others.