Executing a loop, doing something else, then back to the same loop

I have a very simple script for clicking something in chrome in certain locations and repeating the said process about 15 times. After it finishes it's 15th time, I want to run a different location of 2 clicks. I can't quite figure out what to use to make it trigger this second part and then go back to the main 15-time loop to do it again. I see the "if then" control flow option. I tried putting that in and saying if the script was true to execute the series of other 2 clicks. But the other 2 clicks never happen. And then I have to figure out a way to go back to the original 15-click loop once the 2 clicks are completed.

Howdy, welcome to the forum! As you might have already figured out, this is a great community full of people who love to help.

This sample macro might be a good basis for you. It basically repeats the first “set” of actions 15 times, then moves on to the second “set”, repeating them twice, then starts the entire process over from the beginning.

See if it’s something that can serve as a basis for what you want to do, and if not, let me know and we can go from there.

-Chris

Macro Screenshot (click to expand/collapse)

Execute 15 actions- then 2 actions- then repeat.kmmacros (4.5 KB)

Hi @cdthomer - Retry This Loop should normally be placed inside a loop and not outside as you have it. I would suggest that for predictably correct operation you enclose the two Repeat actions inside another loop that is designed to repeat until some end condition obtains, dependent on how the OP wishes it to operate.

1 Like

True, thanks for the reminder. This is really just a proof of concept though, not designed to be a final macro by any means.

1 Like