Search code examples
xcodeapplescript-objc

ApplescriptObjC - display text field text on a label


I have been stuck in this for many days and I could not find the solution and documentation for ApplescriptObjC seems very low online, what I want to do is to copy a text from a text field to a label using ApplescriptObjC in Xcode 4.6 here my code and my bindings:

and I receive this error

2016-08-05 16:10:32.114 BoxEye[12604:303] *** -[AppDelegate selectSource:]: Can’t make «class ocid» id «data optr00000000C04AF40901000000» into type string. (error -1700)

property parent : class "NSObject"
property myLabel : missing value
property textFeild: missing value


on selectSource_(sender) 

       myLabel's setStringValue_(textFeild)

end selectSource_

here is my interface my bindings


Solution

  • I would try doing

    myLabel's setStringValue_((textfield's stringValue()) as text)