How can I set my mouse to click whenever it stops moving?
macOS Sierra has built-in Dwell Control, which you can enable in the Accessibility system preferences. It's primarily designed for people using eye- or head-tracking devices, but you can certainly use it with just the mouse/trackpad, so it's probably worth trying that first.
For full instructions, see Apple's support article.
This is not a direct solution to your question but, I hope some of these suggestions will make your life a little bit easier.
Mac accessibility features are awesome. Once you identify what your needs are and what the computer can actually do for you, You can virtually set up custom dictation commands, and use other accessibility features to control your entire computer.
The first thing I would suggest is enabling enhanced dictation commands in your accessibility preferences. You can create custom voice commands to make your life much easier. For example, I have set up custom commands to open up any webpage I frequent by simply saying “open Facebook“ or “open youtube“ etc.. Once I realized how easy it was to automate tasks on the computer, I started reading about AppleScript and learning how to create scripts and applications that I could control with my voice and create custom commands for those also. For example, I created Applescripts that would insert my username and passwords into what ever fields I needed to insert them in. Now for those scripts, which I made speakable, all I have to say is “insert username” or “insert password” and my computer does everything for me.
Also using the dictation commands, there is a command that you could say “show numbers” in any open application (see image…)
Then all I have to do is say "14" If I wanted to click on the highlighted "Dictation". Making life even easier, you can even just select or highlight something, while enhanced dictation is active, and say "make this speakable" and your computer will launch the dictation commands set up dialogue for you:
You may also want to look into these items in the Accessibility preferences:
Here is an auto clicking solution you may be interested in.
Activate “Enable Mouse Keys” in System Preferences/Accessibility/Mouse & Trackpad.
You can paste this following script in a new Script Editor document then export it as an application (naming it something like “Auto Click”).
tell application "System Events"
delay 1 -- this line is optional
key code 87
end tell
You can then locate and select that new Auto Click.app in Finder, and once that file is highlighted, you can simply speak the command “Make This Speakable” (assuming you have advanced dictation commands enabled in your system preferences). You can then configure this new Dictation Command to run the Auto Click.app (which will click immediately wherever your mouse cursor is located) whenever you speak your new command.
Be sure to add Auto Click.app to the list of applications allowed to control your computer.