The numeric field in the Repeat loop, like pretty much all numeric fields in Keyboard Maestro, can contain an expression, which can also include variables or functions. Here is an example showing how you can repeat a variable number of times.
Note that "Count" in the Repeat action will show up in red until it has a valid numeric value (usually when you run the macro the first time and enter the value in the Prompt. You can select the Prompt For User Input action, and click the Try button and enter a valid number to ease your mind that all is well.
How do I change this so that it says repeat actions count times?
When I add the Repeat action it defaults to this, I want the user to be prompted each time to input a different value at the Prompt for User Input: see attached picture.
Instead of a static number in the Default Value field of the prompt, you can add a variable. So adding %Variable%Count% in the Default Value gives you the last value āCountā again. Super handy when doing really repeated steps.
Are you sure itās not repeating the correct number of times? If you want to be sure, stick a Prompt action inside the loop, and count the number of times it comes up.
What do you do inside the loop? Can you post your macro?
Change the Title (#1), and clear the Prompt (#2). It will display a prompt like this:
So each time through the loop, this prompt will display. Click OK to let it continue, and count the number of times the prompt displays.
Also, make sure you add a Prompt to the end of the macro (after the Repeat), so you know when the macro finishes.
Now, as you begin to try and figure out what's really going on, you can add Prompts in various places in your macro, to let you know it got that far, and also to let you look at your application and make sure it's where it's supposed to be, automation-wise. And you can always click "Cancel" to stop the loop, at any time.
I got to thinking that this could cause a problem, since youāre debugging UI automation. Every time the Prompt dialog pops up, the āactiveā application will change. Now in theory, when you click OK, it will probably return to the application youāre trying to automate, but 1) It might not happen instantly and 2) thereās no guarantee whatever control was focused is still focused.
So just be aware of that. Itās conceivable you could need to add a short Pause after a prompt, to allow the application to get its focus back. I suppose itās even possibly youād need to add an Activate Application action, although I doubt it.
Is it possible to adjust or specifically increase the Loop_Max variable from within the list of repeated actions in order to extend the repeat count beyond its initial value (i.e. to allow more time to obtain a desired result)? The actions above fail to achieve an extended delay, but maybe I'm confusing text and numeric fields.