2 Questions Re Actions: For Peter

Hi Peter, I just spent some time re-organizing my macros. Two issues came up re: some actions.

Q 1
Re: the Prompt User Action: How long will the prompt user dialog box remain open and active (I'll clarify in a sec) before the user selects the "OK" button. To clarify: Assuming it takes the User some time to execute the prompt (not a very long time but, let's say, one minute, or two--or even three minutes), will the macro continue to execute in its intended sequence, after it receives the input and the OK button has been selected (again, even if the User took a long time to do input the prompt)? If the answer is 'Yes,' how much time does the User have?

Apropos to this Q: Can the amount of time be adjusted (without adding a Pause Until action, for example).

Q 2
Re the Retry Loop action. I've been using the Retry Loop action recently, and here again, a timing issue came up. I'll give an example:

(I think because my macros are becoming more complex), my Cancel macro hasn't been as effective. So: I created a hardball Cancel Macro that (so far) instantaneously cancels any macro, any time, in any situation. It ends with Retry This Loop. While the macro seems to be bullet proof, some events have occurred (during its execution) that made me wonder, how long does the Retry Loop action continue?

Related to this question, with regard to the phrase, "This Loop" (in 'Retry This Loop''), I assume you're referring to those actions already executed in the macro where it resides (and not to any other actions)? Is that correct?

See a screenshot of my "bulletproof" Cancel macro below.

Thx in advance.

The default timeout is 99 hours.

Yes, in the action (gear) :gear: menu.

I don't understand most of this paragraph.

The RetryLoop action does not have any limits. It does not have a timeout, since its action is immediate. It simply restarts executing actions from the start of the surrounding loop.

The Continue Loop, Break From Loop, Retry Loop, refer to the surrounding loop (or currently, surrounding Group, but that is a bug), or failing that, to the macro as a whole.

So in your example, the Retry Loop action would execute the first action of the macro next and continue from there. Except that it will never execute since the Cancel All Macros action will cancel all the macros, including this one, so the last two actions will never run.

Thx for this.

(In my confusing paragraph) what I was trying to say is pretty simple: I had this idea that maybe the 'Retry Loop' action was executing in the background...that's all. That's obviously wrong. Mind if I ask - I didn't get one part of your answer. When you say, "...the Retry Loop action would execute the first action of the macro next and continue from there" (I think) you're saying, the Retry loop would normally return to the first action and then execute the actions yet again, in sequence, but since my macro shuts itself down, it never gets to that point. Is that right?

To follow-up one more step - if the loop actions weren't buggy - in your next version of KM or whatever - will Retry go through each action in the macro or group, once--and that's it? Or is it your intention to continuously loop until something changes programmatically - or a break intentionally stops it. That's partly what I was trying to get at before. In other words: (If it wasn't buggy), is it supposed to be a one-time 'Retry,' or a continuous 'Retry' - until something occurs to break the loop. Anyway...thx again ...I removed the retry action and my Cancel macro is just as effective, like you say,,,

Yes. If you want to think in terms of “GOTO”, you can break the various actions down to their core like this:

  • While condition X do
    • Action

is the same as:

  1. If not condition X, GOTO 4
  2. Action
  3. GOTO 1

In this context, Repeat Loop is essentially GOTO 2, and Continue Loop is essentially GOTO 3.

Yes, your macro just does:

  • Activate Keyboard Maestro
  • Pause 1 Second
  • Cancel All Macros

Nothing happens after that since the macro has been canceled (it could have a warning on the action).

What do you mean? The only loop related bug is that the Group action is considered a loop.

Retry Loop is just a GOTO - it just continues execution from the first action in the containing loop (currently the containing loop, containing group or containing macro - in v9, the containing loop or the containing macro).

It will keep repeating any time you use it.

The primary difference between the Repeat Loop and the Continue Loop is the end of loop condition behaviour. For Repeat Loop, the loop is restarted, so the condition is ignore. For Continue Loop, the remainder of the loop’s actions are skipped, and the condition is reevaluated as to whether to loop again. This is especially import for the For Each action, as the Repeat Loop will restart the loop with the index variable unchanged, whereas the Continue Loop will proceed to the next iteration with the next index value.

thx again...