I try to run the following shell script in a Hazel rule:
- Code: Select all
#!/bin/bash
/usr/local/bin/ocrmypdf --deskew --clean --rotate-pages "$1" "$1"
The script should use the open source tool ocrmypdf (https://github.com/jbarlow83/OCRmyPDF) to perform optical character recognition. In the terminal, the script runs fine. (The double "$1" is not a mistake, this means that the input file should be overwritten)
However, in Hazel it does not, I get the error "Shellscript exited with non-successful status code: 1".
Following advice in this forum, I enabled the debug mode to see if the logs would give a hint what is going wrong. Strangely enough, enabling the debug mode fixes the problem, the Hazel rule runs fine. When I disable debug mode, the script will fail again.
Does anyone have an idea what is wrong here? I would appreciate any help.
Cheers
Chris