Embedded Script Not Working

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

Moderator: Mr_Noodle

Embedded Script Not Working Sun Mar 25, 2012 1:52 pm • by SuperDodge
I am trying to make a rule to run HandBrakeCLI.

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.
SuperDodge
 
Posts: 5
Joined: Thu Oct 08, 2009 6:13 pm

Re: Embedded Script Not Working Sun Mar 25, 2012 6:12 pm • by tc60045a
You tell bash that you are setting a variable, so that $moviename thrown in there will not work.

Try this, it works:

Code: Select all
LONG_FILENAME="$1"
VPATH="/Users/michelle/Documents/AutomatorFolders/5-atv-to-copy/"
VARIABLE=$(basename "$LONG_FILENAME" .dvdmedia).m4v
VBOTH=$VPATH$VARIABLE
HPARMS=" -f mp4 --main-feature --preset=\"AppleTV 2\""
nice /Applications/HandBrakeCLI -i "$1" -o "$VBOTH" $HPARMS
tc60045a
 
Posts: 9
Joined: Tue Nov 15, 2011 10:55 pm


Return to Support