Action sub menus, ie an action which triggers a menu of actions to select from

Hello, I have a few different sort actions (thank you @sylumer ) and would like to create a parent sort action which would display a menu from which I would choose one of my many possible sort action which I have installed. If possible, it would allow for a significant gain in time and space and improvement in workflow. My question does not only concern sort actions. If action submenus are possible, I would rethink the way my actions are organized.
thanks very much for your time and help

A couple of options come to mind.

The first one, and one I tend to use from buttons on the keyboard row, is to pop up a prompt which has one button for each action I might wish to run. It looks quite menu like. Tapping on the button queues up the action to be run next.

A second option could be to have an action load and show a different action group which contains the actions you want to select from. Each action at the end then loads, and potentially displays, the previous action group.

The first option is certainly relatively easy to put together but the options are displayed in different screen areas, whereas the second is a little more cumbersome to maintain but keeps the user selection interactions in one place.

Hope that helps.

1 Like

It’s obvious that @sylumer would get here first :smile:, but as a representative of the non-Javascript community on here, this should be possible with the combination of a prompt step and then a drafts url step in an action. So your prompt would be a list of action names you wish to select from and then the prompt result gets passed through to the url to run the desired action.

Screen grabs to illustrate how to set up.

1 Like

I would recommend a tweak to that non-scripted method, replacing the URL step with an Include Action step, which just uses [[prompt_button]] as the action name.

The reason being that passing to the /runAction URL is telling Drafts to run the action on the passed text, not the current draft. A subtile difference, perhaps, but if the action contains steps that alter the original draft, archive it, or create log entries which could be of value, they would not be associated with that original draft when using the URL.

1 Like

hello, I have difficulty following you. I found the first part corresponding to the first image, ie the prompt menu, but can’t find the part corresponding to the second image where URL template and options is written.
thank you

hello Greg,

to help non java script users and also less intelligent users like me, would it be possible that you create an example with a prompt and the choice of 3 actions, and perhaps a short explanation on how to edit it. Users like me could simply duplicate edit your action to suit our needs. I am spending hours into trying to figuring this out.

In terms of workflow, being able to use prompts would be a tremendous advantage because it would shorten the list of actions and keep the entire list within the visible screen, and avoid having to scroll down a long list of actions

I am using drafts as a tool to improve my workflow, not because I want to develop some technical proficiency in creating actions.

thanks very much in advance for your understanding

Look at this action.

It uses three actions from the Basic action group. If you edit the first step you will see them listed at the bottom.

1 Like

thank you very much !! an absolute gem. Extremely useful ! have a nice weekend !

Greg, is there a manual or videos where you teach how to create actions in some detail ?
It sometimes seems that users have to run around pleading for help for information which should be straightforward if they had a detailed manual to consult.
Without @sylumer’s help, I would be completely lost. And once again, he saved the day today with the action he kindly wrote below.
thank you

If you haven’t looked at these, then you should. Most of the information you are after probably does already exist on the Drafts web site; but even then, this forum is here so people can ask questions and get advice.

Add to this the post that @agiletortoise did this afternoon re. ScreencastsOnline, there are a few Drafts tutorials there too.

Just be aware that I’m linking to the previews, the courses are paid for.


I will read / view all the documentation. thanks very much