脚本抛出了一个未捕获的 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");