Updated to 8.1 version - 2021/02/19
.... 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.
FindText - Capture screen image into text and then find it
Re: FindText - Capture screen image into text and then find it
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
---------------------------
Re: FindText - Capture screen image into text and then find it
@Avastgard
Fixed it! Thank you for your feedback.
Fixed it! Thank you for your feedback.
Re: FindText - Capture screen image into text and then find it
You're welcome.
This is such a great tool!
This is such a great tool!
Re: FindText - Capture screen image into text and then find it
Updated to 8.2 version - 2021/03/03
1. Add: Added a search direction (dir = 5): From the Center to all around.
2. Modify: The size of machine code is reduced.
1. Add: Added a search direction (dir = 5): From the Center to all around.
2. Modify: The size of machine code is reduced.
Re: FindText - Capture screen image into text and then find it
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!
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!
Re: FindText - Capture screen image into text and then find it
@Qhimin
Maybe this is a BUG of Ahk_H version, you can try like this:
Maybe this is a BUG of Ahk_H version, you can try like this:
Code: Select all
Gui(cmd, arg1:="")
{
;-- local ;-- Comment out or remove this line
static
Re: FindText - Capture screen image into text and then find it
Thank you very much @feiyue ! It does worked!feiyue wrote: ↑08 Mar 2021, 00:34@Qhimin
Maybe this is a BUG of Ahk_H version, you can try like this:Code: Select all
Gui(cmd, arg1:="") { ;-- local ;-- Comment out or remove this line static
Re: FindText - Capture screen image into text and then find it
Thanks for posting this.
Last edited by denysy1 on 08 Mar 2021, 14:56, edited 2 times in total.
Re: FindText - Capture screen image into text and then find it
I'm testing out this script. I've encountered some weird behavior:
When trying to run the script to recognize some text in a program that if running in full-screen mode, the script does find the text, but when I try to move the mouse to the reported co-ordinates, it moves to some to a wrong location. What's even more interesting is that the offset from the correct location is not consistent. Depending on where on the screen the text appears, the offset is different. Any suggestion on what could be causing this behavior?
When trying to run the script to recognize some text in a program that if running in full-screen mode, the script does find the text, but when I try to move the mouse to the reported co-ordinates, it moves to some to a wrong location. What's even more interesting is that the offset from the correct location is not consistent. Depending on where on the screen the text appears, the offset is different. Any suggestion on what could be causing this behavior?
Re: FindText - Capture screen image into text and then find it
@denysy1 you can change the coordinates yourself.
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().
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().
Re: FindText - Capture screen image into text and then find it
Hello there. I need to search for an image that is bigger than 50 x 50. How can I do that?
Also what is the difference between Capture and CaptureS?
Thanks for the continued work on this script!
Also what is the difference between Capture and CaptureS?
Thanks for the continued work on this script!
Re: FindText - Capture screen image into text and then find it
I'm also wanting this, i've tried to put a higher value but doesn't work
Re: FindText - Capture screen image into text and then find it
@Dillweed
Although there is no detailed explanation, but you can touch more to understand each function,
as long as the mouse moves to each control, there will be a function prompt.
Expand the size of the selection box to adjust the width and height of the main interface and click apply.
The CaptureS function is used with hotkeys to capture pictures, and the screenshot hotkeys are also set in the main interface.
Although there is no detailed explanation, but you can touch more to understand each function,
as long as the mouse moves to each control, there will be a function prompt.
Expand the size of the selection box to adjust the width and height of the main interface and click apply.
The CaptureS function is used with hotkeys to capture pictures, and the screenshot hotkeys are also set in the main interface.
Re: FindText - Capture screen image into text and then find it
@feiyue
I'm sorry, I'm not sure that I understand what you are saying, but I think I found a workaround by taking two captures and then doing work on those captures.
Really, I was hoping to find a way to capture an area of 100 x 12. Is that possible without capturing two areas?
I'm sorry, I'm not sure that I understand what you are saying, but I think I found a workaround by taking two captures and then doing work on those captures.
Really, I was hoping to find a way to capture an area of 100 x 12. Is that possible without capturing two areas?
Re: FindText - Capture screen image into text and then find it
Expand the size of the selection box to adjust the width:35 and height:12 of the main interface and click apply.
adjust “ Height:12 ” to “ Height:50 ”, The actual height is 101 (2*50+1).
adjust “ Height:12 ” to “ Height:50 ”, The actual height is 101 (2*50+1).
Re: FindText - Capture screen image into text and then find it
Updated to 8.3 version - 2021/03/19
.... 1. Add: Now You can set the capture mouse when capturing an image Use FindText.CaptureCursor(1) .
.... 2. Add: The FindText.ImageSearch() function is added, which is completely similar to
....... the built-in command ImageSearch, The coordinates are set by "CoordMode, Pixel" .
.... 3. Add: A new ScreenShot selection window has been added.
....... Now you can get multiple screenshots using hotkeys,
....... and then click the "CaptureS" button to select which screenshot to restore.
.... 1. Add: Now You can set the capture mouse when capturing an image Use FindText.CaptureCursor(1) .
.... 2. Add: The FindText.ImageSearch() function is added, which is completely similar to
....... the built-in command ImageSearch, The coordinates are set by "CoordMode, Pixel" .
.... 3. Add: A new ScreenShot selection window has been added.
....... Now you can get multiple screenshots using hotkeys,
....... and then click the "CaptureS" button to select which screenshot to restore.
Re: FindText - Capture screen image into text and then find it
I have the script loaded into my script and working. But I can not figure out how to replace the msgbox with a stop/go result.
With imagesearch (which wasn't detecting my image) I used.
Can FindText be setup for the same output?
Got it working
With imagesearch (which wasn't detecting my image) I used.
Code: Select all
ImageSearch, Px, Py, 219,105, 288, 388, test.bmp
If Errorlevel
sleep, 200 ;pic not found, to continue my loop
Else
Pause ;pic found, to pause my loop to look at screen, then hotkey to resume the loop
Got it working
Code: Select all
if (ok:=FindText(407, 184, 521, 660, 0, 0, Text))
{
CoordMode, Mouse
X:=ok.1.x, Y:=ok.1.y, Comment:=ok.1.id
Click, %X% %Y% 0
Pause
}
Else
Sleep, 100
Re: FindText - Capture screen image into text and then find it
Hi, need help please, how do i manage to work with multiple monitors?
I've got a laptop and sometimes work with an external monitor, and it won't work with different monitors,
for this situation, do you have some advice to solve the problem? thanks very much!
I've got a laptop and sometimes work with an external monitor, and it won't work with different monitors,
for this situation, do you have some advice to solve the problem? thanks very much!