The instructions no longer work out-of-the-box with the current version of templater. Templater 1.7.x seems to work, but the latest 1.12.x appears to have broken the line containing tp.user.ocr. I don’t have time to troubleshoot at the moment. Sorry.
Could you please help guide me on what templater command I should put for window?
i tried: 'C:\Program Files\Tesseract-OCR\tesseract.exe' "$ocr_input" - but console saying syntax is incorrect.
Hey, sorry. I don’t have windows so not entirely sure what to put there. If you have access to cygwin or the Windows Subsystem for Linux, you might be able to get that working by installing tesseract in cygwin or WSL and setting your Templater system shell to bash, but I’m not able to test that out
My guess is the default shell in windows is cmd.exe and you might try ’C:\Program Files\Tesseract-OCR\tesseract.exe' "%ocr_input%" … likely have to play with tesseract at the command line to get the right command
Ok, i was able to make some progress with: powershell 'C:\Program Files\Tesseract-OCR\tesseract.exe' '%ocr_input%'
I think this should work for user function.
The current problem now i think is the ocr_input is giving the obsidian path instead of system path.
Thanks. That’s interesting. The relative obsidian path works okay on my mac, but that must not work on windows. You could change your system command to include the path to your obsidian vault, e.g. powershell 'C:\Program Files\Tesseract-OCR\tesseract.exe' 'C:\Users\...\???\Documents\notes\%ocr_input%' … (guessing at a workaround here)
Yep, it does work!
The console showing the correct path.
However, Obisidian link seperate folder structure with / while window seperate folder with \.
Is there a way to replace the forward/backward slash in ocr_input?
Not really. There is a lot of missing context: what platform you are on, have you verified there aren’t any copy paste errors, etc. you can also try commenting out parts of the template to see where the error is from on your setup.
supposedly there is support for it but if it’s not working out of the box, I’m not sure what the next step is. I believe there is a way to use custom training data or data files from this SO post, but it looks a little dated. @fred1357944
I am trying a lot to get this running, but the problem lies with the fact that somehow it has problems recognizing tesseract as a function in powershell. If i do it manually, I can get it to run.
I added
C:\Program Files\Tesseract-OCR\
to Path Variable.
Copied your template, still an error message. Getting frustrated right now, would you be able to expand a bit what exactly you did?