Page 1 of 1

lib not found

Posted: 07 Jun 2016, 02:57
by ToKa

Code: Select all

New to Autohotkey, this is my first attempt to use the lib folder.
I downloaded the OCR.zip file from here and extracted its contend to
C:\Documents and Settings\%username%\My Documents\AutoHotkey\Lib
From there i copy'd on of the Test example scripts to my regular script folder
on my Desktop
C:\Documents and Settings\%username%\Desktop\scripts
the script contains a 
#Include OCR.ahk
line which is indeed present in the lib folder
when running the script i always get a message that ocr.ahk was not found.
According to the documentation for the #include statement it seams that it should be found?
What am i doing wrong here?

i did try running this from within the lib folder and it is working there.

Re: lib not found

Posted: 07 Jun 2016, 03:36
by jNizM
https://autohotkey.com/docs/commands/_Include.htm wrote:LibName
[v1.0.90+]: A library file or function name. For example, #include <lib> and #include <lib_func> would both include lib.ahk from one of the function library folders.

Code: Select all

#Include <OCR>

Re: lib not found

Posted: 07 Jun 2016, 05:16
by ToKa

Code: Select all

Thanks jNizM that worked fine,it found the lib
But now i got another Problem there are 2 executables in that lib
djpeg.exe and gocr.exe
they are called from the ocr.ahk script
the lines pertaining are:

Code: Select all


djpegPath=djpeg.exe
   gocrPath=gocr.exe
   
;ensure the exes are there
if NOT FileExist(djpegPath)
      return "ERROR: djpeg.exe not found in expected location"
if NOT FileExist(gocrPath)
      return "ERROR: gocr.exe not found in expected location"

convertCmd=djpeg.exe -pnm -grayscale %filenameJpg% %filenamePnm%
Runwait, %comspec% /c %convertCmd%,, Hide
   
runCmd=gocr.exe %additionalParams% %filenamePnm%
Runwait, %comspec% /c %runCmd% > %filenameTxt%,, Hide

Code: Select all

Well i get the Error: djpeg.exe not found in expected location
Message. Also strange that statement djpegPath suggests that a Path could be
included here, but at the actual call the file name is used directly.

Any way to fix this so they can stay in the lib?
And how would that affect when the script gets compiled?