Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Now that you have learned how to get and set GUI object values programmatically, it's time to experience some magic. Bindings are very cool and can save you from writing a lot of code. So far, we have been getting and setting values for the properties using Objective-C methods. Using bindings will eliminate this "controller" code and directly update the properties as the values change in the GUI, and vice versa.
A full discussion of Cocoa bindings is beyond the scope of this book. However, for simple tasks, they are fairly straightforward to use. What this means is that you can update the value of your properties from AppleScript by referring to the property using AppleScript's special my keyword. When the values are updated in your code this way, the GUI objects they are bound to will update automatically. The reverse is also true. When a value is changed in the GUI, the property it is bound to will be updated. It is a very cool mechanism!