Closed mathieutu closed 4 years ago
Just tried, got the same error. Updated Alfred, and it worked again. Can you try plz?
Alfred and Tesseract are at last versions on my side, but it's seems normal for tesseract:
$ tesseract /tmp/ocr_snapshot.png stdout -l
Error, unknown command line argument '-l'
Maybe a condition in the bash script?
Right! A PR fixed that: https://github.com/nicooprat/alfred-ocr/pull/2. Can you update your script and try again?
Script is up-to-date, but there isn't any check in script 😕
I believe the part 2>&1
prevents error from breaking output: tesseract /tmp/ocr_snapshot.png stdout -l {query} 2>&1
.
No, not at all 😅
I made the 2>&1
part, and it's precisely to redirect error to stdout, and so to message.
I personally can't see any difference before/after the #2 PR 😕. Maybe @dkgrieshammer could explain to use what s.he did ?
well the {query} causes an issue if empty, 2>&1 redirects an error but the -l still requres an argument; so basically checking if {query} is empty works as shown below;
export PATH=/usr/local/bin/:$PATH
screencapture -i /tmp/ocr_snapshot.png
if [{query} = ""]; then tesseract /tmp/ocr_snapshot.png stdout 2>&1 else tesseract /tmp/ocr_snapshot.png stdout -l {query} 2>&1 fi
I totally agree with this message, but if I download the binary in the PR you made, the script isn't unchanged compared to before the PR.
Maybe did you forgot to do something?
As we talk about a binary it's difficult to compare versions, so I think it will be better to see that with #5 solved.
dkgrieshammer's proposed solution works. Should be included.
I provided a pull request which includes @dkgrieshammer's proposed solution and also solves #7.
Feel free to close the issue if the PR fixed your issue 👍
When no lang is provided.