A follow-up to my earlier item about using secure text fields: Apple’s mailing list comes through again. Tim Bumgarner, the tech lead on Applescript Studio, emailed me to point out that I could address the secure text field as a regular text field instead since the secure text field class inherits from the regular text field class.
What I find interesting about this is that it points up some interesting philosophical differences between Applescript Studio and other environments I’ve programmed in. Here, to address a control or other user interface element, you need to specify the control by class, for instance
get contents of text field "userPassword" of theWindow
Note the quotation marks around the text field name? The control’s names are not bound at compile time but are interpreted–good and bad; you can pass the name in as a string variable but you don’t get any protection from the compiler if you make typos.