脚本引发了一个未被捕获的JavaScript错误:
Cannot perform action on invalid element: UIAElementNil from target.frontMostApp().mainWindow().popover().actionSheet().buttons()["Save Note"]
代码:
var target = UIATarget.localTarget();
var app = target.frontMostApp();
var window = app.mainWindow();
target.logElementTree();
UIALogger.logPass("Stick Note Save Start");
app.navigationBar().toolbar().buttons()["Plus"].tap();
app.keyboard().typeString("Ki");
window.popover().actionSheet().buttons()["Save Note"].tap();
UIALogger.logPass("StickNoteSaveEnd");