[help help] How to automatically restart when the Keyboard Maestro action is canceled

First, I apologize for my poor English skills. I am a non-English speaking citizen. I am using Google Translate.

When an action fails for some reason and the macro is canceled, is it possible to automatically run another macro? Or is it possible to continue the current macro from the next step of the canceled action?

I tried using the "if then else" action, but it failed...
I don't know how to use it. I wanted to make it like [if A action fails], [then execute B macro group], [else continue current macro]
However, I also failed to create the condition [if A action failed] haha.

------Let me explain my situation in more detail.

I mainly use the "click at found image" action to create macros that automatically find and access something I need. However, sometimes the macro does not run smoothly due to slow loading or a temporary internet connection.
Other actions do not cancel the macro, even if they do not work as designed. However, the "click at found image" action will cancel the macro itself if the image is not found!

So, even if the "click at found image" action fails, the macro is not canceled and moves on to the next action, or there is a need for a way to automatically run the A macro group if the macro is not running for more than a certain period of time...

please help me please please

Hi, @simcity5317 ; welcome to the Keyboard Maestro forum.

Since you are a new forum user, I'm going to refer you to three references that will make your time here much more efficient:

After read the above and post your draft macro, I'm sure someone on the forum will be able to help you.

1 Like

Probably better than blindly reexecuting the macro, use a Pause Until action with a Found Image condition to pause until the image is there, and then click on the image. You can use the Click on Found Image with the same image, or use the FoundImage token to get the location of the found image after the found image condition and click there.

Alternatively, you can use the Try or Catch action to catch the failure and retry it, something like:

  • Set variable Done to false
  • While variable Done is false
    • Try
      • Do stuff
      • Set Variable Done to true

[Pause Until] was ineffective not because the images were slow to load, but because there were times when a page appeared that did not contain any images at all.

However, the problem was solved with [Try or Catch]. Thank you very, very, very much!!!!
You are my savior!!