FindText tutorial

Helpful script writing tricks and HowTo's
Dark Sage
Posts: 1
Joined: 25 May 2024, 16:04

Re: FindText tutorial

Post by Dark Sage » 25 May 2024, 16:05

Did anyone convert this FindText script to Ahk v2 yet? I used it alot in v1 but changed a while ago to v2

User avatar
boiler
Posts: 17406
Joined: 21 Dec 2014, 02:44

Re: FindText tutorial

Post by boiler » 25 May 2024, 16:18

It’s literally one of the first several threads in the “Scripts and Functions (v2)” section of the forum:

viewtopic.php?f=83&t=116471

mrcooper
Posts: 5
Joined: 27 May 2024, 18:55

Re: FindText tutorial

Post by mrcooper » 30 May 2024, 19:06

how to capture the image text using function instead of the ui?
for example with the specific coordinates of the screen?

Code: Select all

Text:=GetTextFromScreen(0, 0, 100, 100)
MsgBox Text
I'm trying this but it doesn't work.
What is the problem?

User avatar
boiler
Posts: 17406
Joined: 21 Dec 2014, 02:44

Re: FindText tutorial

Post by boiler » 30 May 2024, 19:28

In v1, MsgBox Text would just produce the word Text, not the contents of the variable named Text.

feiyue
Posts: 355
Joined: 08 Aug 2014, 04:08

Re: FindText tutorial

Post by feiyue » 30 May 2024, 20:33

@mrcooper That function belongs to a method within the class, so it cannot be called directly. You can try this:

Code: Select all

Text:=FindText().GetTextFromScreen(0, 0, 100, 100)
MsgBox % Text

mrcooper
Posts: 5
Joined: 27 May 2024, 18:55

Re: FindText tutorial

Post by mrcooper » 30 May 2024, 20:47

@feiyue
Thanks alot bro. :bravo:
This is a really nice script.

Post Reply

Return to “Tutorials (v1)”