Help with menu choice into Dropbox action

I have what might be a really dumb question that I feel like should be easier than I’m making it.

My goal is to choose from a menu. Then for the next step to be to add a txt to Dropbox, with the contents being the draft, and the title of the file being MenuChoice.txt

I tried a script step to generate the menu and then the built in add to drafts and using [[MenuChoice]].txt as the file name but it doesn’t actually fill in the choice, but rather the literal characters. [[MenuChoice]].

Am I missing something obvious. The script I have is this.

var p = Prompt.create();

p.addButton("Option");
p.addButton("Another");
p.addButton("TheThird");

var didSelect = p.show();
var MenuChoice = p.buttonPressed;

You would need to define a custom template tag. Variables in scripts to not automatically become template tags.

Add this at the end of your script:

draft.setTemplateTag("MenuChoice", MenuChoice);

Then, in subsequent steps, [[MenuChoice]] will be available. See related docs.

Thank you! It’s working now. I appreciate your time.

1 Like