Number of option-fields depending on input

Hi,

I'm trying to build a macro, which outputs text strings to generate a HTML select/dropdown field.
The problem is to offer a flexible way for the options.
I would like to have a field to ask for the number of options, for example "3". Then, in a second step, I need the appropriate amount of option-fields to enter for example "apple", "orange", "banana".

Is this possible with Keyboard Maestro?
Thank you very much for your help!
Peter.

There are multiple options, some easy, other more complex.

  • Use a Repeat loop and ask for one element at a time. Very easy, but not particularly elegant.
  • If the possible number is limited to some finite number, use a Switch action and for each option, use a different Prompt for User Input action. Straight forward, but tedious to set up, but elegant to use.
  • Generate the XML for an extensible Prompt for User Input action and execute that. Tricky to set up. Limited to the size of the screen.
  • Use a Custom HTML Prompt action. Tricky to set up.

Hi Peter,

wow, a lot of possibilities.
Thank you very much for your help!