macos 使applescript 自动点击
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4399083/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
make applescript auto-click
提问by help
I play a game in Safari.
我在 Safari 中玩游戏。
I want to make an applescript that auto clicks for me in a special spot on the screen, I have tried many things but none of it has worked for me.
我想制作一个可以在屏幕上的特殊位置为我自动点击的applescript,我尝试了很多东西,但没有一个对我有用。
Any ideas how to do it?
任何想法如何做到?
回答by Sylter
You can record the mouse movement with Automator and play this record: you can save it as application, too... It's the easiest way, in my opinion...
您可以使用 Automator 记录鼠标移动并播放此记录:您也可以将其另存为应用程序...在我看来,这是最简单的方法...
回答by superarts.org
delay 3 tell application "System Events" tell application process "TheApp" key code 53 delay 1 click (click at {1800, 1200}) end tell end tell
However, it doesn't seem to work in Mavericks.
但是,它似乎不适用于小牛队。
回答by Kristian Flatheim Jensen
I was trying to achieve the same thing as you a few months/years ago :)
几个月/几年前,我试图实现与您相同的目标:)
I was botting(the thing you want to achieve) a game named Runescape =P
我正在 botting(你想要实现的东西)一个名为 Runescape =P 的游戏
Of course it is against the rule so you may get banned :S
当然,这是违反规则的,因此您可能会被禁止:S
As sylter says you can use Automator to automate your task (which is the only solution) i tried to click the mouse button but i was not able to find out how :/
正如 sylter 所说,您可以使用 Automator 自动执行您的任务(这是唯一的解决方案)我尝试单击鼠标按钮,但我无法找到方法:/
you should use automator! it is REALLY easy :)
你应该使用自动机!这真的很容易:)
回答by John Riselvato
repeat 10 times
delay 1
tell application "System Events"
tell application process "Safari"
click (click at {650, 730})
end tell
end tell
end repeat
should work for you
应该为你工作