Found Image Finding Two Identical Images and Cancelling Macro

I have a macro that adds in a pause in KM because I find myself always adding in about .3 second pauses so that the macros are more reliable. If I don't, it clicks or types things too fast and the macro misses an action or two and the whole thing screws up.

So I have created a macro to add a .3 second pause, but I have an If Then Else at the beginning that will search for an existing .3 second pause in the current macro and if it finds that image, it will click on it, copy it, and paste it in where I'm at (rather than searching the list and adding it in by the results window). The problem I'm having is that if I have two of the same .3 second pause visible on screen, the macro sees both and doesn't move to the "otherwise" part of the if then, it just cancels. Any way to fix this? Or I'm open to a better/faster way of adding my pauses. Thanks!

Well as I was typing this I remembered the Control+Command+A shortcut and that makes this macro to add pauses much better. However the problem of finding two identical images and cancelling still is an issue for me. I'd appreciate the help, thanks!

Why do you want to make a macro to do this? Why not "Option+Drag" the Pause action to the multiple places then test. Or use a "Pause Until…" action to look for an active menu item, etc., before continuing?

Because there are plenty of times that I don't have a pause action nearby in a macro I am editing, so I have to go searching for it, or add it from the menu.

You could save a "Pause" action to a named clipboard then paste it at any time by triggering the macro.

These actions would be in separate macros. The first would just be used once to set the "Pause" Clipboard. The second would be given a trigger to be used anywhere in KM.

image

1 Like

Yes this is perfect. Fast and effective. Thanks! Still wondering about finding two identical images on screen though...

1 Like

I think you would benefit greatly from this macro system by @DanThomas:
MACRO: [KMFAM] Favorite Actions and Macros

I have been using this system since Dan created it, and use it often in every macro I write.

Basically, you would create the Pause Action you want, save it to the KMFAM Action List, and then when you need it, just press the hotkey, type in a few chars to ID the pause, and press return. It then inserts the saved Action into your Macro at the current location.

1 Like

The Click Mouse action needs a unique location to click.

Find Image on Screen action can find a non-unique image.

So you can use that and then use the result of that in the Click Mouse action.