Hello, awesome community. Having Keyboard Maestro 11 appear was an instant purchase, since this amazing tool has saved me 14 months of my life, so far (as per the about box).
Like many here, I do a lot of "clicked on found image" actions, but man, it can be super frustrating. I have a script that tries to click on the "Create Post" button for Facebook, then prepare a post for me to schedule:
It works "okay" but manages to fail the first 1-3 times I run it, before deciding it wants to work properly. I go out of my way to always have the browse text size in Chrome set to 1.25% so it's uniform across all devices, but I never know how things will go.
So my question is, is there any way to get the "fail/success" result of a Click on Found Image ahead of time, so I could do something like, if it failed the first time, try this image? If it failed a second time, try this image. Or a loop, or something.
Yes, I know there's a way to get a value of whether an image is found or not. Is that what I need? To pre-search for the products and only try to click if it's present?
It's really frustrating, having constant drama about whether a certain image will be "found" on my laptop (in laptop mode), laptop (docked to a monitor), Mac Studio or Mac Mini M2.
Thanks in advance for helping me solve this frustrating issue!
I feel you. Especially when dealing with text. What about an If action to check if the image is found, like so:
Your idea is valid, but it's twice as efficient to just use the Move and Click action and detecting its failure after the fact, rather than checking and then clicking. What's worse, is that the image could disappear between the check and the click action in your solution, which means you have the exact same problem that you started with. Even worse, depending on the app, the click may not "register" until you do it a second time. Therefore something like this should be more reliable...
The reason I put the Pause action in there is to prevent certain apps from interpreting the clicks incorrectly or maybe as a double click. I'm not sure how important that is, but it works for me.
Another way I do it is like this:
Please notice that the second occurrence of the graphic has "does NOT contain".
This way it keeps clicking until the button has disappeared. That catches certain situations where the app isn't responding on the first click. Also notice that in this case it's possible to move the Pause statement until after the Click action, because it's not being used to test for errors in this example.
I think my brain locked on to "...is there any way to get the "fail/success" result of a Click on Found Image ahead of time" but it looks like the OP was looking for something more like your solution
Personally, I try and avoid using found images as much as possible.
See if this works for you: