Replace placeholders with prompts

#1

Isn’t there a way to have placeholders in a draft and when any action is run it asks for what is to be used to replace that placeholder? Similar to LCP, which has [[prompt]] and every time you run it, a prompt is displayed asking for input.

0 Likes

#2

No. That isn’t functionality that exists currently in Drafts.

Personally I wouldn’t want that to be the case. Imagine running an action to set the selected text to be bolded in Markdown syntax… and being prompted for entering a dozen placeholders scattered throughout the draft. :confounded:

You could of course write something into a particular action. Parse the content, grab a list of placeholders, run through an input prompt for each, substitute in the text and update the draft or apply to subsequent action steps accordingly.

0 Likes

#3

I use this action (created something around for my needs. A little bit of work to start with it and use it but its really awesome!
https://actions.getdrafts.com/a/1IS

In fact i created my own action with uses the script from @dchar above and this one here https://actions.getdrafts.com/a/1IN from @dansays combined. I can now setup some templates with either as “shortcuts” e.g. “.personalAddress” to insert my address or even more complex shortcuts and also use placeholders like [[name]] which will prompt me to replace them with a real value when running the action.

0 Likes