我们可以使用 JavaScript 向 Cocoa 应用程序中的 webview 内的按钮发送点击事件吗?
我正在尝试使用实用程序(优胜美地)下的脚本编辑器进行记录,但不幸的是无法记录 webview 中的任何事件。
我尝试使用 Apple 文档中提供的 UI 自动化部分下的示例代码与https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html的 testapp(带有 webview 的可可应用程序).
TestApp = Application('TestApp')
TestApp.activate()
delay(1)
SystemEvents = Application('System Events')
TestApp = SystemEvents.processes['TestApp']
TestApp.document.getElementById('testid').click(); // stuck at this last line not sure if I can
//even call the document object in this way. Getting error undefined variable document.