I have an action someone else wrote to append the current draft to my Logseq journal. I want to make this more useful by first prompting the user whether the text should be treated as plain text (in which case it will just be like before) or if it is a task, in which case it will append TODO or NOW or LATER to the beginning of the text before posting to Logseq.
I have been able to create a prompt that has four buttons: Text|TODO|NOW|LATER
After a prompt step is run, a new template tag will exist for the for the value of the button. In your example (and the default behavior), would be for that tag to be [[prompt_button]]. You can likely just use than in your “File” step to fill in the value without the need for scripting.
(The key in the prompt step determines the prefix for the tag - so if you have more than one prompt step, you could use prompt2 for the key and the tag would be [[prompt2_button]], and so on.)
If you do need to further construct a string in script from the prompt button, the way to get that value in a script would be:
let button = draft.processTemplate("[[prompt_button]]")
The only reason for scripting was to have the text be blank in certain situations, since there seems to be no way to have a blank prompt button? But I’ve handled that by turning the first prompt to a tag #qc (for quick capture) which can be useful for filtering.