Information Technology Reference
In-Depth Information
Getting started with Automation scripting
Automation scripting is related to the Document Object Model (DOM) used to access the features of web pages.
Like Objective-C, it uses objects and accessors, but the syntax is somewhat different. You don't need to create
classes in your code, because they already exist.
Initializing the script
Scripts typically start with the following boilerplate code:
var target = UIATarget.localTarget();
var thisApp = target.frontMostApp();
var thisWindow = thisApp.mainWindow();
You can then use the object types listed in the documentation for UIAElements to return arrays of UI ele-
ments. For example:
var textfields = thisWindow.textFields();
returns an array of textfields. You can then access the textfields by the name you set in IB
textfields.[“aNameSetInIB”]…
or by the standard numerical subscript
textfields[0]…
Search WWH ::




Custom Search