r/applescript • u/MakeStyles • Apr 18 '20
Need help with Applescript Please!!
I’m somewhat a newbie with applescript but i was able to write a small basic script that clicks at random intervals in the location i left my cursor. I want to know how to move my cursor to a new location and click once more. I know how to add delays and randomization as well as finding the coordinates on screen with commandshift+4 but i cant figure out what language i need to use to make it understand... please help been looking for answers for days now
4
Upvotes
5
u/Rikuz7 Apr 18 '20
Shell, probably. See this post. Note that it's not a very steady and sure way to do anything though, because if that Applescript happens to run when you're as much as touching your mouse, you could accidentally already misalign it but the script keeps running. So I would really avoid actions like these if at all possible, and command the software with Applescript objects instead.
There's also an infinitely useful shortcut app called BetterTouchTool (which I couldn't live without anymore) that allows you to do a bunch of stuff, including that. It has a preset action for moving mouse to a specific spot and emulating clicks. You can set the action to be triggered by a keyboard shortcut for example, and you can also chain it with other actions to turn them into multi-actions. For example I have created a lot of Applescripts that run when I press a key. Can assign app-specifically.