Embedded Script Not Working

I am trying to make a rule to run HandBrakeCLI.
This is the Command Line equivalent I am trying to emulate.
It works if I type the command in at the CLI.
This is the script I have set with /bin/bash as the shell.
Hazel gives me no errors, but no HandBrakeCLI output is generated, either.
This is the Command Line equivalent I am trying to emulate.
- Code: Select all
HandbrakeCLI -i "The Rum Diary.dvdmedia" -o "/Users/sronnie/Movies/Handbrake Encodes/The Rum Diary.m4v" --preset="Normal"
It works if I type the command in at the CLI.
This is the script I have set with /bin/bash as the shell.
- Code: Select all
filename=$(basename $1)
filename=${moviename%.*}
output_filename="/Users/sronnie/Movies/Handbrake Encodes/Movies/$moviename.m4v"
/usr/bin/HandBrakeCLI -i $1 -o "$output_filename" --preset="Normal"
Hazel gives me no errors, but no HandBrakeCLI output is generated, either.