PDA

View Full Version : applescript studio, set button title issue....




butteryak
May 14, 2011, 02:52 PM
I'm getting this error when trying to change the title of a button, and Im not sure what I'm missing....
Can’t set «class butT» "off" of window "window" to "on". (-10006)

this works to change the button from on to off when clicked.....
if title of theObject = "on" then
set title of button "on" of window "window" to "off"
end if



but adding an else statement to change it back results in the error


if title of theObject = "on" then
set title of button "on" of window "window" to "off"


else if title of theObject = "off" then
set title of button "off" of window "window" to "on"
end if



any thoughts?