How to Determine the Line Number selected by ‘Prompt With List from Variable'

Is there a simple way to determine the selected line number for 'Prompt With List from Variable'?

JMichaelTX's solution 'How Would I Get the Line Number of Selected Text in a Variable?' at

is more complex than I want to support.

How about something like this:

Prompt with List uses "1" as the value, but displays the "friendly" portion after the "__" in the prompt.

1 Like

It depends on what you mean. The Prompt With List will display the list differently, depending on the options for the action. If you are talking about the line number of the list itself (as opposed to the line number of the list that is displayed in the prompt), and further if you do not want to (or can't) include line numbers in your list, then you could include a For Each loop after the prompt that compares your choice from the prompt to the line appearing in the loop. Increment a variable each iteration to count the lines, and if your chosen line exactly matches the current loop line, then set a variable to the current value of the counter variable (and optionally exit the loop).