Auto clicker using Apple Mac scripting

I need to make an auto clicker using apple script, or whatever it's called. Im not sure what code to use can someone help, If you have time could you type a code in that click in a specific area and can be stopped and turned on with a button. I'm new to apple scripting so I'm not sure how to make it.

Something like

when x clicked (idk)

click left mouse button 1000000 times

when g clicked end

iMac 21.5″, macOS 10.14

Posted on Dec 18, 2020 5:48 PM

Reply

Similar questions

1 reply

Dec 23, 2020 9:29 AM in response to avi38

It is trivial to simulate a mouse click 1 million times if that's what you really want.


tell application "System Events"
	repeat 10000000 times
		click
	end repeat
end tell


but that's only likely to be half the story. Where do you want this click to happen?


Also, nothing in base AppleScript will detect a keystroke, so your 'when g clicked' to cancel the script is going to be an issue. You need to define some other way to terminate the script.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Auto clicker using Apple Mac scripting

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.