OCR as compiled EXE

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

OCR as compiled EXE

Post by Jerry Thomas » Fri Oct 13, 2017 8:24 pm

I am trying out the new OCR stuff as a compiled exe and it doesn't work.
This runs fine on my development PC, but when I create an exe and try to run from a test pc, no good.

Code: Select all

// Start Notepad first
GetWindowPos>Untitled - Notepad,LEFT,TOP
Let>RIGHT=LEFT+200
Let>BOTTOM=TOP+50
OCRArea>LEFT,TOP,RIGHT,BOTTOM,strText
MDL>strText
At first I got an error that the OCR.dll was missing so I copied to to same folder on test pc (Desktop)
Now I get "Exception EOcrError....Cannot initialize Tesseract library"

What else do I need to copy over to my test machine?
Thanks,
Jerry

[email protected]

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Re: OCR as compiled EXE

Post by Jerry Thomas » Fri Oct 13, 2017 8:31 pm

<smack forehead>
I didn't search enough

viewtopic.php?f=1&t=9591 is the exact same issue and has the answer!

Thanks elenareinoso!
Thanks,
Jerry

[email protected]

colin.rogers
Newbie
Posts: 11
Joined: Sat Oct 28, 2017 11:49 am

Re: OCR as compiled EXE

Post by colin.rogers » Sat Oct 28, 2017 1:48 pm

Hi all,

I am having precisely this same issue with compiled OCR functions. However, I note the guidance on the DLL and language files but see these are present in the target folder as copied there by the compiler itself.

OCRArea works in dev and outputs the variable with the text
Identical code (2 lines) fails in compiled .exe and the variable is empty - on screen window content and position is identical

Anything else I am doing wrong ? Thanks.

Colin Rogers

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: OCR as compiled EXE

Post by Marcus Tettmar » Mon Oct 30, 2017 2:24 pm

That's very odd and I'm not sure why this would be. I'm not seeing any difference in results between compiled and non-compiled versions.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

colin.rogers
Newbie
Posts: 11
Joined: Sat Oct 28, 2017 11:49 am

Re: OCR as compiled EXE

Post by colin.rogers » Mon Oct 30, 2017 4:52 pm

In my case, the failure of OCRArea in the compiled version was down to an out of date compiler which did not recognise the new OCR functions. By uninstalling and reinstalling things, I fixed the bug.

The support team suggested this step in the code, which helped to determine which version I had.

MessageModal>MSCHED_VER

Support was exceptional, thank you.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts