Image search not working

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
omar
Posts: 540
Joined: 22 Oct 2015, 17:56

Image search not working

06 Aug 2019, 06:31

I'm using AHK image search to find part of a on a web page and clicking it - the search box.

It works!

The problem is on a next page it doesn't. It's the same search box.
I think it's bad designing on website. I'm guessing there is a color difference maybe.

IMPORTANT: I don't want to use Selinum or COM. This is an intentional choice.

Is there someway of doing the image search and choosing something that 'roughly' matches the searched image?

Thanks.
gregster
Posts: 9001
Joined: 30 Sep 2013, 06:48

Re: Image search not working

06 Aug 2019, 10:12

omar wrote:
06 Aug 2019, 06:31
I think it's bad designing on website. I'm guessing there is a color difference maybe.
If you have to guess if there is a difference, the design seems to be ok. I don't think that the creator of any website especially cares about if Imagesearch works on it (if they want to allow and/or encourage automation, there are much better ways to do that). But even if... then they probably would want to make sure that automation doesn't work easily ;)

omar wrote:
06 Aug 2019, 06:31
Is there someway of doing the image search and choosing something that 'roughly' matches the searched image?
In terms of color variations, yes. Use *n in the ImageFile parameter of Imagesearch:
https://www.autohotkey.com/docs/commands/ImageSearch.htm wrote:*n (variation):
Specify for n a number between 0 and 255 (inclusive) to indicate the allowed number of shades of variation in either direction for the intensity of the red, green, and blue components of each pixel's color. For example, *2 would allow two shades of variation. This parameter is helpful if the coloring of the image varies slightly or if ImageFile uses a format such as GIF or JPG that does not accurately represent an image on the screen. If you specify 255 shades of variation, all colors will match. The default is 0 shades.
The *TransN option might also help in some cases.
User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

Re: Image search not working

06 Aug 2019, 10:16

If it turns out you're not able to have one ImageSearch command find both of them, you can create a little function for looking for the search box which would perform two ImageSearch commands with their own reference images and return a result based on finding either of them.
omar
Posts: 540
Joined: 22 Oct 2015, 17:56

Re: Image search not working

06 Aug 2019, 17:51

Thanks for the replies guys.
I think the best option might be to have multiple images, more than 2.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: AlFlo and 218 guests