Page 1 of 1

Easy way to fill in combo box, option menu, pop up menu, dro

Posted: Sun May 01, 2016 4:57 pm
by Jordy
I can successfully create these by typing the choice into the property inspector and then using switch statements inside the code. The problem is that I want to make a huge one with like 300+ choices and all of that work would be very tedious. Is there an easier way to get a list of options into there? I can get the list separated by next line then I could paste that list into the inspector. When the user clicks a choice I would like to put that exact word into a variable.

Re: Easy way to fill in combo box, option menu, pop up menu,

Posted: Sun May 01, 2016 4:58 pm
by Jordy
Also I'm not sure the property inspector would recognize a list separated by enter as separate options it may just try to make the whole list one large option

Re: Easy way to fill in combo box, option menu, pop up menu,

Posted: Sun May 01, 2016 9:41 pm
by Randy Hengst
Assuming I’m understanding you correctly….

You could type all of the lines into an LC field and then put this script into a button:
set the text of button "OptionDemo" to field “OptionList"


Or, create multiple custom properties in the option button itself and then use a script like this:
set the text of button "OptionDemo" to the cOptionListOne of button "OptionDemo"

Re: Easy way to fill in combo box, option menu, pop up menu,

Posted: Mon May 02, 2016 3:08 am
by dunbarx
Hi.

Making 300 or even 300,000 menuItems in an optionMenu is easy, even if you don't know what to include in the list.

Code: Select all

on mouseUp
  lock screen
  repeat with y = 1 to 300
    put "XYZ" & y into line y of btn "yourOption"
  end repeat
end mouseUpt
But making the user navigate such a beast is cruel and unusual.

So we must, simply must re-think the UI. Can these go into subcategories, so that a hierarchal menu would do? Can we do almost anything else at all?

Craig Newman.