- Code: Select all
echo $?
And see what that shows ($? is the exit code of the last process). If it's non-zero then that script is erroneously returning a bad exit code.
Moderator: Mr_Noodle
echo $?
tone wrote:The clean install made no difference, so...a_freyer wrote:I'd next add some debug logging to the executable to see which exit 1 is tripping via hazel.
Here's the debug log I get when I drop a .djvu file into Word2Papers:
https://www.dropbox.com/s/l0nv50nbc6yv544/hazelDebug.log
echo $LINENO
Mr_Noodle wrote:When you run it in Terminal, immediately after do
- Code: Select all
echo $?
And see what that shows ($? is the exit code of the last process). If it's non-zero then that script is erroneously returning a bad exit code.
a_freyer wrote:What I meant was to open the executable (which, if the script is the same as the one I found, is merely executable text), in TextEdit and add:
- Code: Select all
echo $LINENO
Before each "exit 1" instruction.
7/23/12 2:09:23.483 PM [0x0-0x3df3df].com.noodlesoft.HazelHelper: 1
23/07/2012 16:37:56.515 [0x0-0x3f2af27].com.noodlesoft.HazelHelper: Error: /usr/local/Cellar/djvu2pdf/0.9.2/bin/djvu2pdf: ddjvu not found. Install djvulibre.
tone wrote:I think this is the culprit:
- Code: Select all
23/07/2012 16:37:56.515 [0x0-0x3f2af27].com.noodlesoft.HazelHelper: Error: /usr/local/Cellar/djvu2pdf/0.9.2/bin/djvu2pdf: ddjvu not found. Install djvulibre.
However, djvulibre is definitely installed - it's one of djvu2pdf's dependencies and I don't get this error when I run djvu2pdf in terminal.
# MacOS and BSD compatibility
which seq >/dev/null 2>&1
if [ $? -eq 0 ]; then
SEQ=seq
else
SEQ=jot
fi
for i in "ddjvu djvulibre" "gs ghostscript"; do
BINARY=$(echo $i | awk '{print $1'})
PACKAGE=$(echo $i | awk '{print $2'})
which $BINARY >/dev/null 2>&1
check_print_error "$BINARY not found. Install $PACKAGE."
done
a_freyer wrote:A search-replace of ddjvu for /path/to/ddjvu should solve this issue if you don't want to change working directories.
NOTE: it seems like this script is very path dependent.... sigh.
a_freyer wrote:I expect you might have to do path prepending for gs as well.
tone wrote:Out of curiosity, is the fact Hazel can't execute shell commands that Terminal has no trouble with a bug, a feature, or something else?
tone wrote:Yes, the PDF was created in the same directory as the djvu file, which is perfect.
Thanks for all your help, Andrew. That must've really tested your patience :)
Although djvu2pdf could help things along by not being so path-dependent, as you say, I had the same problem with epub2pdf (which is why I ended up copying it to the watched folder).