AppleScript单击多个Google Chrome按钮 - 随机停止工作
我正在使用一个相对简单的苹果本来自动单击Google Chrome中的两个按钮。它已经工作了几个星期,但是现在已经随机停止了,而我没有改变任何东西。这是我正在使用的代码:
...
set loc1 to {1200, 400}
set loc2 to {1000, 600}
repeat 30 times
tell application "System Events"
tell process "Google Chrome"
set newest to true
delay 0.2
click at loc1
delay 0.1
click at loc1
delay 0.1
click at loc2
end tell
end tell
end repeat
...
进行了一些实验后,我仍然可以单击Chrome浏览器顶部的标签,但是我无法单击网页上的任何按钮/元素。我可以尝试的事情有什么想法吗?
谢谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@mrstuckguy ,我看到您的问题还没有答案。我认为只要使用GreaseMonKey风格的用户脚本(JavaScript)与HTML元素进行交互,您可能会更好。检查饼干标语。如果您需要烦人的弹出窗口的帮助,请询问。
您会添加一个类似的用户脚本管理器:
您应该知道,这些按钮元素的布局分别不断变化并编辑它们。
@mrstuckguy, I see your question has no answer yet. I think you'd probably be better off just using Greasemonkey-style user scripts (JavaScript) to interact with HTML elements. Check Tampermonkey for example. You have a lot of examples on the web of how to interact with HTML buttons such as those pesky Cookie Banners. If you need help with an annoying popup just ask.
You'd add in a user scripts manager something like this:
You should be aware, however, that the layout of these button-elements keeps changing and redact them respectively.