Sign in to follow this  
Followers 0
Phaser

Simple file reading

3 posts in this topic

I have managed to work with tesseract without using tesseratc.au3 include, just using ShellExecuteWait as I found using the command line with tesseract worked just fine.

I am getting tesseract to perform and return a result like this

ShellExecuteWait(@ProgramFilesDir & "\Tesseract-OCR\tesseract.exe", "image.png out")

The result it prints to out.txt is correct but for some reason I cannot display the result with a MsgBox

$file = FileOpen("out.text",0)
$result = FileReadLine($file, 1)

MsgBox(0,"The Result", "Number " & $result)

As tesseract writes it to the first line each time I just want to display it in a msgbox so I don't have to keep checking the text file, what am I doing wrong?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I have managed to work with tesseract without using tesseratc.au3 include, just using ShellExecuteWait as I found using the command line with tesseract worked just fine.

I am getting tesseract to perform and return a result like this

ShellExecuteWait(@ProgramFilesDir & "\Tesseract-OCR\tesseract.exe", "image.png out")

The result it prints to out.txt is correct but for some reason I cannot display the result with a MsgBox

$file = FileOpen("out.text",0)
$result = FileReadLine($file, 1)

MsgBox(0,"The Result", "Number " & $result)

As tesseract writes it to the first line each time I just want to display it in a msgbox so I don't have to keep checking the text file, what am I doing wrong?

 

your code should read out.txt NOT out.text

:alien:

next time add error check to find problem 

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
Edited by alienclone

if @error Then
	MsgBox(262192,"",@ComputerName&" slaps "&@UserName&" around a bit with a large trout!")
	EndIf

>Exit code: 0

REAL search results

"Yeah yeah yeah, patience. How long will that take?"  -Ed Gruberman

Share this post


Link to post
Share on other sites

LOL, thanks very much, couldn't see the wood for the trees, slap taken gracefully

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0