[英]Applescript JavaScript “End of Line but found identifier” Error when controlling Google Chrome
The following is a part of my AppleScript script that should click an element in the current tab of Google Chrome with name 'connect'. 以下是我的AppleScript脚本的一部分,该脚本应单击Google Chrome当前选项卡中名称为“ connect”的元素。
tell app "Google Chrome"
do JavaScript "document.getElementsByName('connect').click();" in current tab of first window
end
When is runs, it returns the following syntax error: 当运行时,它返回以下语法错误:
Expected end of line but found identifier.
预计行尾,但找到了标识符。
How would I get this to work? 我将如何工作?
Never mind. 没关系。 I figured it out.
我想到了。
Here's the code: 这是代码:
tell application "Google Chrome"
execute front window's active tab javascript "document.getElementsByName('connect')[0].click()"
end tell
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.