Targeting buttons

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
rokkyboy
Posts: 16
Joined: 01 Sep 2017, 07:04

Targeting buttons

12 Jan 2020, 23:44

Hello guys,

When I want to map hotkeys to a button in application that where the application:

+ does not have existing hotkeys
+ does not allow to build custom hotkeys to a button

I have used image recognition and location-based mouse-click as a workaround where both are prone to break.

Does anyone know a better method?

for example... Excel:

Cap 2020-01-13 13-43-52-053.png
Cap 2020-01-13 13-43-52-053.png (42.53 KiB) Viewed 578 times
guest3456
Posts: 3469
Joined: 09 Oct 2013, 10:31

Re: Targeting buttons

13 Jan 2020, 03:45

rokkyboy wrote:
12 Jan 2020, 23:44
I have used image recognition and location-based mouse-click as a workaround where both are prone to break.
how do they break? for example, in your image, you would want to make sure that you are searching for an image of the paint can, but WITHOUT the yellow color underneath. you wouldn't want to search for any color underneath. probably only the white paint can itself

User avatar
telanx
Posts: 68
Joined: 10 Jan 2020, 14:31

Re: Targeting buttons

13 Jan 2020, 04:48

Use relative coordinate system, or use the built-in macro function.

Code: Select all

CoordMode Pixel, Window
SetTitleMatchMode 2
WinTitle:="part of Title text"
if WinExist(WinTitle) {
    WinActivate
    ImageSearch ...
    if found {
        key sequence
    } else {
        more ...
    }
}
User avatar
Chunjee
Posts: 1499
Joined: 18 Apr 2014, 19:05
Contact:

Re: Targeting buttons

13 Jan 2020, 09:42

You can probably improve on your image recognition to get more predicable results. Make the search image smaller, add a viariation option sp that is is found more easily.
rokkyboy
Posts: 16
Joined: 01 Sep 2017, 07:04

Re: Targeting buttons

14 Jan 2020, 06:13

guest3456 wrote:
13 Jan 2020, 03:45
rokkyboy wrote:
12 Jan 2020, 23:44
I have used image recognition and location-based mouse-click as a workaround where both are prone to break.
how do they break? for example, in your image, you would want to make sure that you are searching for an image of the paint can, but WITHOUT the yellow color underneath. you wouldn't want to search for any color underneath. probably only the white paint can itself
Thank you for the response!

Best example would be application update, where the buttons change. Another, will be that what I've created wont work for another person due to resolution differences. Both are for Image Search.

Besides on how to improve on existing methods such as Image Search, I was curious if anyone had a different approach to it, while it may be limited to certain applications. More under-the-hood type.

Thanks!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Chunjee, peter_ahk and 411 guests