on oneButtonClicked_(sender)
set faceNumber's setStringValue() to faceNumber's stringValue() & "1"
end oneButtonClicked_
I get this error: "Can’t make «class ocid» id «data optr000000000058B37BFF7F0000» into type list, record or text. (error -1700)"
faceNumber is a label and when the user clicks the button, I want to add string of "1" to it. So for example, if the user clicked the button 5 times
stringValue returns an
NSString(wrong answer) CFString. You have to make a real AppleScript String to use it. BTW your codeset faceNumber's setStringValue()
is not correct. The reasons are:setStringValue()
you don't need to useset x to
setStringValue()
you must give the parameter between the parenthesesNow put everything together:
or (to have it clearer):
I hope you like the answer, after pressing the button twice you have an 11 at the end of the label.
Cheers, Michael / Hamburg