Is anyone willing to give an opinion on this macro?
It is working, but I wonder if the script can be more elegant.
It will repeat the NEXT mouse click a specified number of times.
It is designed for on screen buttons or arrows with no keystroke option, that sometimes need to be clicked many times to get a desired result.
It comes with some risk, if you click the wrong thing 100 times, it could get you in some trouble.
For now, it has a 25 click limit, just to be safe
Clickanator.kmmacros (10 KB)
Well that's dicey.. you're right to approach with caution.
Perhaps for over the 25 click limit you could pause with a dialog, asking the user if they wish to continue?
(and don't spend all that ad-click revenue in one place haha
Ha! I wasn’t thinking of web browsers, but some of the deeper dialogs inside Finale.
There are arrow buttons for some functions that do not have keyboard or menu equivalents.
Any special reason you used an AppleScript dialog instead of a
Prompt for User Input action?
You don't need the pause-until for prompt. Keyboard Maestro will wait until that action finishes before advancing –
unless you turn on asynchronous in the Execute an AppleScript action.
I'd put in a IF-THEN with a Key-Condition, such that if the spacebar (or whatever) was
down the macro would abort. It's a good idea to put a kill switch in any macro that "goes crazy" like this one.
It's a good idea to have a global cancel-all-macros macro as well.
For me that’s:
It’s a keyboard shortcut I won’t ever hit by accident – is mnemonic – and is quick to access.
I also use the Iconaholic Loud Status Menu Icon, so it’s UNMISTAKABLE that Keyboard Maestro is running.
At least once this combination has saved me from doing major damage to my system.
I had been editing an often used macro and was interrupted several times that day.
When I got back to my computer I reflexively hit the keyboard shortcut for the macro (which norm…
The 1st pause waits for the dialog to close. Without the pause, if the user clicked the OK button (rather than pressing return) it repeated the OK button click.
And yes I have a Cancel All macro!
The 2nd pause is essentially a trigger to get the mouse location.
I’m using AppleScript simply because I’m trying to learn it!
The kill switch idea is a good one.
I might try the reverse to - it only works WHILE holding a certain key down.
Something akin to the safety trigger on a power tool
Here's an update:
I've added some more few safety features.
The User must hold control-option-shift through the entire process, or the macro aborts.
I like this option as it keeps the user active in the process.
Also for safety, I've also slowed the automation down to a less frantic pace.
Clickanator v1.1.kmmacros (12.0 KB)