How to make check boxes with Script
Posted: Fri Mar 25, 2016 4:42 pm
I have a new fun project but I cant get over the first bump. I have found several examples of how to create buttons using a script and a list of names for the buttons. My problem is I need to create Check boxes. I here is my last attempt that still wont work and I don't understand why 
set the properties of btn id pName to the properties of btn "Template"
This makes a check box for me if I stop there but if i jun the entire scrip it just makes a button, not a check box.

Code: Select all
local tButtonNames
on mouseUp
put fld "Field 1" into tButtonNames
send createButtons to me
end mouseUp
on createButtons
repeat for each line tBtnName in tButtonNames
createNamedButton tBtnName
end repeat
end createButtons
on createNamedButton pName
create button pName
put the ID of btn pName into pName
answer pName
set the properties of btn id pName to the properties of btn "Template"
set the name of btn id pName to tButtonNames
put the number of btn id pName into tNum
set the top of btn id pName to (10 + 30 * (tNum - 1))
end createNamedButton
set the properties of btn id pName to the properties of btn "Template"
This makes a check box for me if I stop there but if i jun the entire scrip it just makes a button, not a check box.