JavaScript를 사용하여 Cocoa 앱의 webview 내부 버튼에 클릭 이벤트를 보낼 수 있습니까?OSX에서 자동화를위한 JavaScript Yosemite
유틸리티 (Yosemite)에서 스크립트 편집기를 사용하여 기록하려고하지만 불행히도 웹 뷰 내부에 이벤트를 기록 할 수 없습니다.
애플 설명서의 testapp (webview가있는 코코아 응용 프로그램)의 UI 자동화 섹션에서 샘플 코드를 사용하여 시도했습니다 (https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html).
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.