Skip to content

Change the Contents of Text Fields

This is pretty basic, but we all need to start somewhere. To change the contents of a text field (any NSTextField, including Labels), simple issue this kind of command:

set contents of text field "myTextField" of window "myWindow" to "Hello, World."

Make sure the “name” (not the “title”) of your target object (in this case “myTextField”) is correct in your NIB file in Interface Builder.