FindText - Capture screen image into text and then find it

Post your working scripts, libraries and tools
feiyue
Posts: 260
Joined: 08 Aug 2014, 04:08

Re: FindText - Capture screen image into text and then find it

19 Feb 2021, 11:06

Updated to 8.1 version - 2021/02/19 :beer: :dance:
.... 1. Add: since all the input and output coordinates of the FindText function are relative to the screen,
....... You can use the following functions to convert coordinates to relative window coordinates:
....... WindowToScreen(), ScreenToWindow(), ClientToScreen(), ScreenToClient().
.... 2. Modify: previously, the binding window could not be moved beyond the screen range,
....... otherwise it would not be found. Now this problem has been fixed.

@chaoscreater Now you can change the coordinates yourself. :D
Avastgard
Posts: 56
Joined: 30 Sep 2016, 21:54

Re: FindText - Capture screen image into text and then find it

19 Feb 2021, 20:24

I'm getting an error message when I try to run the latest version:
---------------------------
FindText Tool.ahk
---------------------------
Error: Call to nonexistent function.

Specifically: WindowToScreen(dx:=0, dy:=0, id), x-=dx, y-=dy

Line#
1102: SetTimer,,Off
1103: }
1107: {
1108: WinGetPos,winx,winy,,,id ? "ahk_id " id : "A"
1109: x+=Floor(winx), y+=Floor(winy)
1110: }
1113: {
---> 1114: WindowToScreen(dx:=0, dy:=0, id), x-=dx, y-=dy
1115: }
1118: {
1119: if (!id)
1120: WinGet,id,ID,A
1121: VarSetCapacity(pt,8,0), NumPut(0,pt,"int64"), DllCall("ClientToScreen","Ptr",id,"Ptr",&pt), x+=NumGet(pt,"int"), y+=NumGet(pt,4,"int")
1124: }
1127: {

The program will exit.
---------------------------
OK
---------------------------
feiyue
Posts: 260
Joined: 08 Aug 2014, 04:08

Re: FindText - Capture screen image into text and then find it

19 Feb 2021, 21:00

@Avastgard
Fixed it! Thank you for your feedback.
Avastgard
Posts: 56
Joined: 30 Sep 2016, 21:54

Re: FindText - Capture screen image into text and then find it

23 Feb 2021, 03:55

You're welcome.

This is such a great tool!
feiyue
Posts: 260
Joined: 08 Aug 2014, 04:08

Re: FindText - Capture screen image into text and then find it

03 Mar 2021, 11:53

Updated to 8.2 version - 2021/03/03 :dance: :beer:
1. Add: Added a search direction (dir = 5): From the Center to all around.
2. Modify: The size of machine code is reduced.
Qhimin
Posts: 15
Joined: 30 Nov 2020, 19:24

Re: FindText - Capture screen image into text and then find it

3 minutes ago

Hello Feiyue,

Is this function supposed to work with AHK_H ? Cause I'm trying to make it work there to get the text codes but just after I run the .ahk nothing happens.

Thank you!

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Avastgard, Qhimin and 17 guests