Hi all.
I am creating a macro that is needing to click buttons on my companies Website. By design, we randomise element IDs, classes so i am unable to use a javascript that targets these, and need to rely on other approaches. One option is of course to use the find and click on an image, which tend to work OK, but not always. I am also using an action to select html elements by text content etc, but thats not always possible.
Can I ask what the best options for the 'Move and Click' settings are? There will always ONLY be 1 found result on the page, so the image its looking for will be a unique result.
I guess the first step is to read the documentation about the Move or Click Mouse action. Have you read it? I use this action extensively, daily, and it may have a few anomalies but on the whole it works extremely well. It's so wonderful and useful, I think this product could be renamed "Image Maestro".
https://wiki.keyboardmaestro.com/action/Move_or_Click_Mouse
When you say it doesn't always work, that could mean many things. Did you try turning on the "Display" flag to ensure that there is only one found image? Are you using the "Unique" or "Best" flag in the action? Did you try using "Best"? There is no harm in using "Best" and I find that it's always the best one to choose, especially when, as you say, there is only one match anyway.
Another common thing that people do wrong is drop a mis-sized image into the image well. I think you should explain the exact key sequence that you use to place images in there.
Another common mistake is leaving the KM Editor window running while the KM Engine tries to make a match. In some cases that will cause an error because the image in the image well matches itself.
There are some less common issues, but there's no point in mentioning something that's unlikely until we see your code and your image in the code, along with an explanation of how you placed the image in the action.
I admit I am not known to ready manuals so I will go back and look at the link you sent.
I will look at your other suggestions too and see if that helps. It’s good knowing that this method is known to be reliable so I will try to persevere!
Thanks again
It is reliable if you use it properly, and sometimes that means being wise when choosing the image to search for. For example, if you try to search for an image that is nothing but a solid black square, that will give you some serious problems. I tried using it once to locate all the black chess squares in an online image, and it was completely unusable for that purpose.
Thats funny with the black squares!! I will try not to do that! ![]()