I would like to improve this if I can so I wondered if anyone has any suggestions on the following:
I have two rules in Hazel on the same folder, One says this:
Encode Rule
- Code: Select all
If Extension is MKV
Run Shell Script
Move MKV to MKV Archive
The original BASH script I borrowed from this site some months ago it read:
- Code: Select all
/Applications/HandbrakeCLI -i "$1" -o "${1%mkv}m4v" --preset="High Profile" -v
and worked a treat but it puts the converted file into the same folder as the MKV
so I put a second rule on the folder:
Move to Tag Rule
- Code: Select all
If Extension is M4V and Last Modified is not in the last 3 minutes
Move to folder "to be Tagged"
but the problem I have is that it encodes all the MKV files and then moves all the M4V files, I would like it to move the M4V files as they are finished.
The obvious suggestion seemed to be not to move the files but to use a different destination folder for HandbrakeCLI so I tried this BASH script:
- Code: Select all
DestLoc = "/Users/iand/Video Encoding Temp Folders/M4V-From-Handbrake/" & "${1%mkv}m4v"
/Applications/HandbrakeCLI -i "$1" -o "$DestLoc" --preset="High Profile" -v
But the M4V files are still created in the same folder as the source file.
So my questions are:
1) any BASH experts that might happen to be passing that can tell me why the script doesn't work
2) Any Hazel experts that might be able to advise on using the rules to better manage the converted files as they are created rather than once all MKV's have been converted.
Thanks
Ian