1 person found this helpful
The original UI is based on app.dialogs.add(…). This leads to what we call here a modal “DOM dialog.” Unfortunately, these DOM dialogs are poorly customizable so you won't be able to attach a scrollbar to it. But indeed the DOM provides a Dropdown object, which you can feed from an array of strings. So you could convert that huge sequence of RadiobuttonControls into a Dropdown—as you suggest. (Go into the ReplaceSwatch.jsx file and you'll find the location of the radiogroups and radiobuttons to be replaced.)
Another option would be to rewrite the whole thing using ScriptUI coding. ScriptUI provides a separate framework for laying out dialogs and controls in a much more flexible way. Since there are not many widgets in your interface (assuming we adopt the dropdown trick), ScriptUI might be a practical solution even for a beginner. To get more familiar with this approach give a read to the “Bible” authored by Peter Kahrel: ScriptUI for dummies | Peter Kahrel
And, as a bonus, here is a ScriptUI code that shows how to display colors straight in a dropdownlist:
(Might be confortable if you have many many swatches to handle…)
Do you really have that many swatches? Looks to me like you have a problem other than the capability of your UI. (For instance I see 2 instances of a Black copy 3 with 8 swatches listed below. This is the same for a Black copy 4, a Black copy 5, and a Black copy 6. This looks like a problem with the script.)
Marc Autret I'm veeeery grateful, but after all this case is too overwhelming for my knowledge of coding.
But i'll definietly come back to this after some learning. Probably more for my own satisfaction and not for work.
Also thank you for that ScriptUI tutorial. Learned a lot.
S Hopkins it is just an example, that i did quickly just to show my problem