以下是我的 AppleScript 脚本的一部分,它应该单击 Google Chrome 当前选项卡中名称为“connect”的元素。
tell app "Google Chrome"
do JavaScript "document.getElementsByName('connect').click();" in current tab of first window
end
当 is 运行时,它返回以下语法错误:
Expected end of line but found identifier.
我如何让它工作?
最佳答案
没关系。我想通了。
代码如下:
tell application "Google Chrome"
execute front window's active tab javascript "document.getElementsByName('connect')[0].click()"
end tell
关于javascript - Applescript JavaScript "End of Line but found identifier"控制谷歌浏览器时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29287388/