lib not found

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ToKa
Posts: 26
Joined: 23 Apr 2016, 04:37

lib not found

07 Jun 2016, 02:57

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.
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: lib not found

07 Jun 2016, 03:36

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>
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
ToKa
Posts: 26
Joined: 23 Apr 2016, 04:37

Re: lib not found

07 Jun 2016, 05:16

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?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Rohwedder, zabbn and 113 guests