value of check box


I’m having trouble getting the value of a check box.

set copysongs to value of check box "ccopy" of window "mainwin"

I get an error saying “expected end of line, ect. but found class name”

Thanks in advance,


Check boxes are buttons. As a checkbox they have a checked and unchecked state. You can check the state of the button and if it returns 1 it is checked, 0 if unchecked. Therefore give this code a try:

set copysongs to state of button "ccopy" of window "mainwin"


I think you can also refer to the contents of the button, like so:

set copysongs to contents of button "ccopy" of window "mainwin"

It should return true or false, depending on the state of the button. I’m unsure what would happen if you had a mixed state checkbox though.

Anyway, this way works for me. Good luck!