Hi @chrscheuer,
With the following example script;
var guitarBrands = ["Fender", "Gibson", "Taylor", "Martin",]
var favoriteGuitarBrand = sf.interaction.selectFromList({
items: guitarBrands,
prompt: "Select your favorite guitar brand:",
defaultItems: ["Fender"],
onCancel:"Abort",
}).list[0];
log(favoriteGuitarBrand);
I'd like to have the prompt list window's array list become focused so that I can select items via typing the first letter of the selection I want to choose;
Is this possible?
Thanks!
Linked from:
- Andrew Scheps @Andrew_Scheps
I think this is actually a general bug in a lot of the sf.interaction dialogs. They don't come up focused when they first display.
Christian Scheuer @chrscheuer2020-06-22 13:01:01.346Z
Yea this is because those dialogs are implemented with Apple Script which apparently doesn't focus stuff correctly.
Instead, use popupSearch which (mostly) takes care of the focusing.
Kitch Membery @Kitch2020-06-22 16:26:58.009Z
Thanks @chrscheuer, I’ll give that a try!
- In reply tochrscheuer⬆:
Kitch Membery @Kitch2020-06-22 17:25:33.874Z
Thanks @chrscheuer & @Andrew_Scheps,
This works great!
var guitarBrands = ["Fender", "Gibson", "Taylor", "Martin"]; var selectedBrandName = sf.interaction.popupSearch({ items: guitarBrands.map(name => ({ name: name })) }).item.name; log(selectedBrandName);
- JIn reply toKitch⬆:Jonas Orantin @Jonas_Orantin
Hi @chrscheuer,
I'm also facing this issue : my sf.interaction.selectFromList dialog doesn't come up focused...
But I need my selection to be multiple, and I think popupSearch doesn't support it...Would you have any suggestion to have a great focused dialog AND the ability to have a multiple selection ?
I tried to force the focus of the popup dialog with a "bring UI element to front" but it seems not to be a classic UI element...
Any idea ?
Thank's
- NNicolas Aparicio @Nicolas_Aparicio
Try this mate: