I'm working on an application where I have one text field, and below it, a "Send" button. When the button is pressed, is sends whatever is typed in the field to all the user's Skype contacts. I have to prevent the user from sending a blank message to all contacts, so I have to change the button's setEnabled. I've been using an NSTimer to check every second, which works, but it lags my application hugely. Is there any handler that is run whenever text is added or deleted? Perhaps something like:
A specific text field is not used in the handler call - the delegate method is called for all text fields. In the case where you have several text fields, you can get the notification's object, for example:
on controlTextDidChange_(aNotification) -- a text field changed, so check it out
set thisTextField to aNotification's object() -- the current control being changed
set theText to thisTextField's stringValue()
Note that you need to connect the text field's delegate outlet to your AppDelegate (or whatever class you are using for the delegate).