interaction select from list. Focus workaround?
Hello everyone,
I'm using this code to select from list but the window doesn't focus, I tryed this solution:
https://forum.soundflow.org/-2349, but I need to select multiple items, is there a workaround for this?
const chooser = sf.interaction.selectFromList({
prompt: "Choose Masters to Commit:",
title: "Available Masters",
defaultItems: recTracks,
items: recTracks,
allowMultipleSelections: true,
}).list
Thank you.
Linked from:
- Chris Shaw @Chris_Shaw2020-12-19 22:23:00.026Z
I don't think there is. As Christian stated at the bottom of the post you referred to, it seems to be a bug with AppleScript not focusing the window when it's opened.
If I had to guess, the solution might be to have a background script running to detect if an applescript window is opened/exists and then focus it if it is. I'm not sure how to implement that however.
samuel henriques @samuel_henriques
Thank you Chris,
Might be a good idea. I'll try not to obsess with this one too much, just to save me 1 click! 🤪Christian Scheuer @chrscheuer2020-12-20 03:45:32.774Z
In your case, where you need multiple selections, the following won't work, but for the cases where you just need a single selection, you can use the
sf.interaction.popupSearch
method instead