Skip to content

Instantly share code, notes, and snippets.

@Dulani
Last active August 18, 2020 00:12
Show Gist options
  • Save Dulani/0cdacb6aaa29fe8b4f87eeae9a5e7b81 to your computer and use it in GitHub Desktop.
Save Dulani/0cdacb6aaa29fe8b4f87eeae9a5e7b81 to your computer and use it in GitHub Desktop.
(*
Use AppleScript to repeatedly click some part of the screen on a Mac 50 times with a 2 second pause between clicks (use on poorly designed applications that don't let you repeat a certain action).
https://apple.stackexchange.com/questions/266784/how-do-i-make-the-mouse-click-at-current-location-using-applescript
Comment: To supplement @jksoegaard's answer: one can also find cursor positions using "Screenshot" tool, which may be activated by Cmd+Shift+4 shortcut. Then just point the cursor to any area and remember the numbers that is shown near the pointer.
*)
repeat 50 times
tell application "System Events"
click at {1073, 373}
end tell
delay 2
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment