Skip action macro

Hi Friends!

Is there a way (without using debugger window) to skip an action in a macro, and then continue with the rest of the macro?

For example:

Say I am running a macro, interacting with a web page, and I have the action "Pause until found image" running.

I would like to be able to hit a hotkey that would cancel the "Pause until found image" action, and instead continue with the rest of the macro, without using the debugger window (cumbersome).

Thanks!

You could do something like this:

It is important to set so that "any" of the conditions is true rather than the default "all"

That way the pause lasts until either the image is found or your key is pressed.

It might be good also (depending on what your Macro does) to set the Timeout of the Action to something like 10 minutes so that if nothing happens after 10 minutes (no found image or your key press) the Macro continues anyway.

2 Likes

If KM had a function called STARTSECONDS() which returned the fractional number of SECONDS() since the macro started, then we wouldn't have to hide this sort of functionality inside the Timeout properties of the action, but we could make the functionality explicit.

Yeah, thanks all- but I am hoping I can have a 'skip this current action' hot key..

@peternlewis ?

For some macros, it can be useful to set (e.g.) local start to NOW(), and then test for elapsed time based on NOW() - local start, but to “make the functionality explicit” in the sort of case described here, just a note in a comment action might suffice!

Was there any reason that @Zabobon’s suggestion would not work for your needs?

Yes, if he was willing to modify all his code where he wants to be able to skip an action, Z's idea would work. But I think the poster has a legitimate point. And here's an example where he couldn't (easily) modify the code:

image

Chances are under 10% that Peter would add this to the debugger, but his request seems reasonable.

Just to be clear: my question was straightforward and I did not intend any comment on the worth of the proposal.

1 Like

I'm sorry for implying otherwise.

Sure, do something like this:

Macro 1:

Macro 2: Triggered by desired hot key

1 Like

So, you are wanting to cancel and move on from whatever the current Action a currently running Macro is at? So, the equivalent of "Cancel Current Macro" or "Cancel All Macros" but instead "Cancel Current Action of a Particular Running Macro"?

Not at all, there was no subtext in my reply there either. Nor is there a hidden meaning in this reply... :smile:

My first thought was to use two macros for @airy’s example above, but my second thought was:

Again, though, I understand that is not the integrated solution that OP wants.

I don/t think he wants that. I think he wants the equivalent of "Break from Loop" to apply to a single action. For example, if the Debugger is showing this action: (either running or paused, I presume)

He wants to be able to make the Execute action return "true" without having to meet the condition, so that the next action in the macro runs.

Oh! This would work quite nicely... Thanks @Zabobon @kevinb @peternlewis

2 Likes

Thanks, All. Best forum ever.

1 Like

Totally works, though I think the feature might be nice so I wouldn't have to edit all my existing macros.. Thanks!

Yup, that would be nice.

This works