Prompt Menu from Action Group

I’m wondering… Is it possible to set up an action group whose actions will be dynamically reflected in a prompt.

What I’m aiming at:

Each time I add or remove an action from group “Quick Actions”, the associated prompt action will present a menu of buttons for running these actions, and will automatically be updated to reflect whichever actions are in that group.

I’m thinking this would be a more efficient way of updating prompt actions, by simply modifying this designated group, rather than changing the prompt action itself each time I want to tweak it.

I’m guessing this is probably fairly straightforward… Search for actions in a group, generate button prompt for each action etc, however I’m still a newbie with js for some reason I tend to struggle the most with creating arrays, iteration etc
:woozy_face:

Yes it is.

That sounds pretty reasonable.

Is that you asking for some sort of support, or someone to build it for you?

I’m going to assume the former and you just need a nudge to tell you that you are on the right lines and perhaps some pointers to what you might need.

Now, you could roll your own from scratch, but I’m going to point you instead to a couple of my action groups that include actions that will take out a lot of the prompt and trigger coding that would otherwise be required, allowing you to focus just on the population of an array of action names.


In the ThoughtAsylum action group there is a helper action called TAD-Action Menu.

This is a helper action called from another action that sets up several template tags to populate the menu.

There is an example action in the ThoughtAsylum - Power User action group called TAD-Info Menu that you can clone to build your own action menu.

It uses actiondisplaynames and actionnames template tags to list the buttons and the actions they trigger (first line in one maps to first line in other, etc.

It uses prompttitle and promptmessage template tags to specify the name and message for the prompt the user chooses from for which action to run.

The ThoughtAsylum - Power User action group, as noted above, contains TAD-Info Menu.

You could duplicate this action, and modify it to use a script to set the actiondisplaynames and action names tags.

I would recommend looking at the following to help you build a list of action names, and to set the two template tags (for your use case they would be identical).

Key Points

  1. “Find” your action group to get access to an array of action objects.
  2. Each action object has a “name”.
  3. Get the name of each of those actions and build a list with each action name on a new line. A good way to do this is to build an array of just the names and “join” them together with new line “\n” characters for example.
  4. “Set” the two “template tags” of the current draft to be the list, and your action should be all set.

Hope that helps.

Give it a try. If you get stuck, post your code and people will be able to point you in the right direction.

3 Likes

I just put something together which maybe shout fit your needs: ActionPrompt | Drafts Directory

please try this and report if this helps :slight_smile:

2 Likes

Literally your answer wasn’t there when I pressed reply.
I just looked at the TAD-Info Menu Action but it throws an error for the first two options, only the specific drafts works on my end. I reinstalled the actiongroup but it didn’t help:

I fixed that issue at the end of May. Do you have the latest version of the ThoughtAsylum Action Group (not the Power User one) on your device?

1 Like

thanks that fixed it… btw is ther any action which updates all installed ThoughtAsylum ActionGroups ?

Thank you both for the assistance! @FlohGro I tried the action, however for some reason when I select an action from the Prompt, the same action is executed regardless of which button is pressed. @sylumer I’m going to take a closer look at the TAD route this evening, as this looks like a good learning opportunity.

Great :slight_smile:

No. I’m not aware of any mechanism to push updates to action groups like that.

1 Like

Thanks for reporting, I was able to reproduce it and fixed it. Please update the action: ActionPrompt | Drafts Directory