Run rule on Video_TS folder in sub-folder (HandbrakeCLI)

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

Moderator: Mr_Noodle

I am having trouble setting up a rule/script to do what I want. I understand that Hazel runs rules in order and I understand that it will stop monitoring a file or folder after the first match. That last part is what's tripping me up.

All my files are dropped in to a folder, "Completed/". Often, the files I want to process are Completed/subfolder. As such, I have a rule set up to process files in subfolders. I also have a rule set up to use HandBrakeCLI to convert my movies to iTunes using the "theFile" syntax and built in scripting to process everything. The script works fine if I drop a Video_TS folder in to Completed/. The problem is that usually it looks more like Completed/Subfolder/Video_TS/.

How can I make this work?

I love this product and I appreciate the support!
josephbphillips
 
Posts: 8
Joined: Sat Nov 17, 2007 4:49 pm

I think I am all set here. I would love to know if there is a more direct answer, but my solution was to peg my script to a file in the VIDEO_TS folder, then include a section in the script to create a variable set to the parent folder of "theFile".

______
tell application "Finder" to ¬
set theFolder to quoted form of POSIX path of ¬
(container of (theFile) as text)

do shell script "HandBrakeCLI -i " & theFolder & " -o " & quoted form of the POSIX path of theFile & ".m4v --preset=\"AppleTV\""

tell application "Finder"
move theFile to the trash


_____

Other ideas are always appreciated!!
josephbphillips
 
Posts: 8
Joined: Sat Nov 17, 2007 4:49 pm

If the folder is always going to be VIDEO_TS, then you can set the Hazel rule to look for that. Otherwise, the way you are doing it now may be the way to go.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support