Hi, just a message to suggest it would be useful for the addSegmentedControl prompt field (and maybe also the addSwitch and addSelect fields) to be optionaly active as a button.
Here’s the use case. In a few scripts, I use prompts with addSegmentedControl and addSelect fields. The addSegmentedControl field is obviously used to select a value, but not only : the items of the addSelect field depends also on the addSegmentedControl value. When I change this value and press the button, I get a new prompt with the corresponding items in addSelect ; when I don’t change the value, the prompt returns all the selected field values.
Prompts are showed in a loop until the addSegmentedControl value is not changed.
let p,
controls = ['one', 'two', 'three'],
control = 'one',
items = {
'one':['a', 'b', 'c'],
'two':['d', 'e', 'f'],
'three':['g', 'h', 'i']
};
while (true) {
p = Prompt.create();
p.addSegmentedControl('control', '', controls, control);
p.addSelect('item', '', items[control], [items[control][0]]);
p.addButton('OKAY');
let didSelect = p.show();
if (!didSelect) {
break;
}
if (p.fieldValues['control'] == control) {
break;
}
else {
control = p.fieldValues['control'];
}
}
alert(p.fieldValues['item']);
I wonder if it would be possible and worth to get the same result just by changing the value of the addSegmentedControl field, acting thus as a button. It would then not be requested to press a button and it would thus go faster and would be more convenient in certain cases.
I hope my message is clear. Please ask me if you have questions.