How to Launch Templater Templates with Input Prompt – Resolved ✅

As others, one of the reasons I use Obsidian, is the possibly for customisation and with that, being able to adapt it to the way I think and work.

One tool I use for this is Templater: To give structure to my notes as well as automatically save them in the right place, I’ve built a number of Templater templates that do all that for me. To aid this, I’m prompted to provide a name when launching a Templater template that gets used in different places in the note creation.

All this works well when within Obsidian – Now I’d love to launch these templates directly with AfO.

Here as example, the first lines of my “Concept” template:

---
creation date: <% tp.file.creation_date("YYYY-MM-DD HH:mm") %>
modification date:
<%*  
let title = tp.file.title  
if (title.startsWith("Untitled")) {  
title = await tp.system.prompt("The concept:");  
await tp.file.rename(title);  
}
%>
tags:
  - 
aliases:
  - <%* tR += title %>
  - 
noteType: concept
short name: <%* tR += title %>
templateLastUpdate: 2024-02-16
---
<%* await tp.file.move("/03 Think/Concepts/" + tp.date.now() + " " + title )
%>
# Concept: 
> <%* tR += title %>

Here how the prompt looks like in Obsidian:

The challenge I face when I launch this Templater template through AoF is that I’m not prompted for the input. It rather creates a file with only md which I understand is part of automatically adding the .md.

My question: How can I launch a Templater template and still get prompted for the input?

Alternatively – and much nicer – would be to get the dialog from Shortcuts and fill that input into the Templater template but that exceeds my abilities.

Wondering if anyone has an idea!

What happens in Templater stays in Templater :wink:

But seriously: Prompting you for input there is a Templater-internal functionality and as such not supported by the plugin Actions URI or, in addition, Actions For Obsidian. AFO does not parse the Templater templates and therefore has no idea what input the user will be prompted for. Templater itself should prompt you, though. And AFAIK there’s no way to pass external input (e.g., input coming from AFO/Shortcuts) to Templater in a way that it would be accepted as input for those prompts.

That said, you could Shortcuts to prompt you for the name of the new note, have AFO create the note for you, and have Templater tp.file.title placeholder where you’d like the name of the note to appear, but that wouldn’t help with the automatic moving of the note. For that, I have no answer other than doing it in Shortcuts – but in the end, this would mean abandoning Templater logic (= inside Obsidian) in favor of Shortcuts logic (= outside Obsidian), and I don’t know if you would want to do that.

Maybe I don’t get the issue right, but with this AFO call Templater asked for the title:

@czottmann – Thanks for the insight, was wondering about passing input through but good to understand that “What happens in Templater stays in Templater”…

@leif – This is it! So simple that it could be a bit embarrassing to not have thought about it myself. Thanks so much, this takes my AfO use def to a new level. Now I just need to find the “Resolved” check box :wink:

Update: On Mac OSX it works fine, on IOS it gets stuck. This is not a big problem – the most important, being prompted for input and note creation happens works. It is probably because of the Templater prompt the shortcut doesn’t finish properly, it then ends on a black screen that is AfO turns out to be AfO. Just wanted to share if others encounter the same.