User-customizable drop-down menu

I have a Macro which types some text based on the option selected from a drop-down menu.
Is there a way to let the user permanently add a new option from the user input prompt?

Maybe an option “Add new item” that allows the user to add the new option name and the text to paste when the new option is selected.

How do I do this?

Hi Manuel,

Here's a working example of how this can be achieved. This version requires Keyboard Maestro 8, but the same goal can also be accomplished with slightly different actions in Keyboard Maestro 7. Feel free to ask if you have any questions.

Customizable Dropdown Text Prompt.kmmacros (9.3 KB)

Start with three options:

Type a new one in the "Add New Item" field:

Get notification:

Next time macro is run, we see the new option included:

1 Like

Thank you!
Is there a way to permanently add also the text to paste when the new option is selected?

You’re quite welcome. I’m afraid I don’t quite know what you mean, though; all of the text options in the dropdown menu, whether newly added or not, are already set to be pasted once selected, and there’s also already an option to paste newly added entries when adding them to the menu as well. If this doesn’t answer your question, could you explain in more detail what you mean by “permanently also add the text to paste”?

For example, if the new item on the drop-down is “John Smith”, I don’t want to paste “John Smith”, but some other text related to John, like his address.

Yes. The KM popup menu can use alternate values; i.e. The user sees and selects the displayed text, but the KM variable is set to the hidden alternate value.

See Prompt for User Input action -- How to Store a Different Value than Displayed (KM Wiki)

The two values are separated by two underscores: __

So, instead of entering just Option 4 in @gglick's macro, you would enter:
Alternate Value to Store__Option 4

OR in your terms:
123 Main Street, Houston, TX__John Smith

Make sense?

1 Like