Code: Select all
q::
TempFile := A_Temp . "\temp_capture.txt"
FileDelete, %TempFile%
;RunWait, Capture2Text_CLI.exe -s "1805 22 1897 33" -d --whitelist 1234056789/ ,,Hide
;RunWait, supplyandblackonwhite.bat,,Hide
RunWait, Capture2Text_CLI.exe -i black_on_white.png --whitelist 1234056789/ -o %TempFile%
sleep 1
FileRead, CaptureText, %TempFile%
FileDelete, %TempFile%
var := StrSplit(CaptureText,"/","`r`n")
var1 := var[1]
var2 := var[2]
MsgBox % var[1] "-" var1 "`n" var[2] "-" var2
if ((var1 < var2) && (var1 > 9) && (var1 < 201) && (var2 > 2) && (var2 < 201))
{
sbflag := 0
; Loop 3 {
; SoundBeep
; Sleep 50
; }
}
Return
Capture2Text_CLI.exe and this script works perfectly whenOCR-ing screen rectangle, but I can not OCR the image placed in the same directory. I am sure that image with the name black_on_white.png exist.