1.
Yes. You should write a system-level script that generates JavaScript code from the data and calls the Instruments from command line. A sample script is:
#!/bin/bash
echo 'var thisIsAGeneratedInput = "Sample Input variable";' > input.js
instruments -t test.tracetemplate your_app_with_path.app -e UIASCRIPT test.js
The file "test.js" should look like:
#import "input.js"
UIALogger.logMessage(thisIsAGeneratedInput);
2.
The function value()
is the proper way to get the requested information, name()
returns the accessibility ID if given. Note: in XCode 5 value()
might not work, use name()
for workaround, but prior to version 5 it was OK.