applescript studio, set button title issue....

Discussion in 'Mac Programming' started by butteryak, May 14, 2011.

  1. macrumors newbie

    Joined:
    May 12, 2011
    #1
    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?
     

Share This Page