Trouble with getting shell script working in Hazel

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Works fine when run in terminal. (PDFjoin is a symbolic link to /System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py)

The result is test.pdf, which is CoverPage prepended to getstarted_guide.pdf (or more technically accurate, getstarted_guide appended to CoverPage.pdf).
Command is PDFjoin -o Outputfile Inputfile1 Inputfile2

In Terminal this works perfectly.
PDFjoin -o "/Users/Me/Documents/~Automated Folders/Add Cover Page to PDFs/Done/test.pdf" "/Users/Me/Documents/~Automated Folders/CoverPage.pdf" "/Users/Me/Documents/~Automated Folders/Add Cover Page to PDFs/getstarted_guide.pdf"

Using the following in Hazel as embedded script results in the test.pdf having the cover page and just a blank page appended.
PDFjoin -o "/Users/Me/Documents/~Automated Folders/Add Cover Page to PDFs/Done/test.pdf" "/Users/Me/Documents/~Automated Folders/CoverPage.pdf" $1

Ultimately I need something like below, so that the resulting files have the same names as the input files. But this doesn't produce any output files.
PDFjoin -o "/Users/Me/Documents/~Automated Folders/Add Cover Page to PDFs/Done/"$1 "/Users/Me/Documents/~Automated Folders/CoverPage.pdf" $1
Houdini
 
Posts: 3
Joined: Sun May 12, 2013 12:18 am

Try putting $1 in quotes (") and see if that fixes things.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support