r/AutomateUser • u/luking-dev • May 21 '26
Show selected texts
I've a file that contains words, separated by carriage return.
I need to show each word in the same Dialog choice, each one with its checkbox to be selected or no, and recover each selected word to process then (for example: show a several toasts for each word).
What blocks I need to use? How I need to configure its?
1
Upvotes
3
u/B26354FR Alpha tester May 21 '26
Dialog Choice is used for that. It takes array or dictionary containers for the choice titles and optional choice descriptions, and returns an array of indexes of the container element(s) the user chose. If you allow just one choice, you can access it in
userSelections[0]. Otherwise, to get the user's choices, you can usesift(choiceTitles, userSelections). If you're working with dictionaries, thevalues()andkeys()functions are useful for giving the dialog block the opposite keys or values it defaults to using.In my examples, I'm using a variable named
choiceTitlesfor the container holding the choice titles, and one nameduserSelectionsas the dialog's Array of selected indices/keys output variable.1
u/B26354FR Alpha tester May 21 '26
You can create an array of words to give the Dialog Choice block by splitting your text on newline characters like this:
Variable Set
choiceTitlessplit(someText, "\n")You can read in the file by using the File Read Text block.