I have a script like so:
var target = UIATarget.localTarget();
var mainWindow = target.frontMostApp().mainWindow();
var element = mainWindow.textFields()["UserID"];
element.setValue("Hello World");
UIALogger.logStart("Logging element tree ...");
target.logElementTree();
UIALogger.logPass();
What I want to do is read a text file or database connection, so I can replace the "Hello World" with either a value from a text file or a database query. Is this possible in the Instruments application with using javascript to control UI Automation for the iphone simulator?