Trigger is setup for my setup which is off a Stream Deck. Adjust as needed.
Macro switches to Google Chrome, goes to the first tab and prompts if you want to close it or not. If you say Yes, it closes the tab and goes to the next. If you say No, it goes to the next tab. If you say Stop, the Macro stops.
I made this because my Chrome browser just overflows with tabs. This was a quick executable that made me sit down and clean it out by just saying yes or no.
Not exactly a coding masterpiece, I know. But I was looking at my Chrome browser and what a mess I always make it. This just seemed like a good way to make me clean it now and then.
Anything that does a job faster than you can do it by hand is an improvement – even if it's clunky.
As you gain proficiency with Keyboard Maestro some of that clunkiness will diminish, and some won't – because some jobs just can't be done smoothly on macOS.
Good job
Also you can use “switch cases” instead of “if then else”.
The cancel macro button automatically cancel the macro and you don’t need to creat a new action for that.
Cheers