Page 1 of 1

Finding mp4's in subfolders & moving them to master folder

PostPosted: Sun Sep 20, 2020 8:31 pm
by scanfile99
Find mp4 videos in a specific folder’s subfolders and move those subfolders to a folder labeled “MP4 Videos”

I have many subfolders that have only mp4 videos in them and I want to gather all those mp4’s to one place where I can further sort them at a later date.

This setup only looks for subfolders that contain mp4 vids and will move the subfolder even if there are other non-mp4 files in it. I know that some subfolders will also contain some jpg, avi, mkv, mov, fav, etc. but I primarily want to get all the mp4s gathered for now.

I find that Hazel works best for me if I don’t try to do too many operations at one time.

So, after jumping all over the internet and never finding the exact example I needed … here is how I finally got it to work for me …
=========================================
Misc Videos To Sort

Name: Look in All Folders & Subfolders for MP4

If all of the following conditions are met

Kind is Folder

Do the following to the matched file of folder

Run rules on folder contents
Continue matching rules (The thing that hung me up for a long while was the use of the “Continue” rule. Hazel wouldn’t run on subfolders until I added it. I have never used it before.)
===============================
Name: Find MP4 in Subfolders & Mv Subfolders to MP4 Folder

If all the following conditions are met

Subfolder Depth is 0 On this rule, I had to “Option Click” on the First Item “Subfolder Depth” “Plus” symbol and create a nested condition. I have never used it before either.

If any of the following conditions are met for any of its subfiles or subfolders

Extension is mp4

Do the following to the matched file or folder:

Move to folder: MP4 Videos Options

========================================================================================
So the two things I learned today was the use of “Continue” and “Nested Condition”.

I wish there were more Hazel Examples out there because it seems like I have re-invent the wheel every time I try to set up what seems to me a very simple sorting rule but then, I am not a programmer so this type of thing is hard for me.

I learn best by example.

I hope this example helps someone out there.

Stay Safe !

Re: Finding mp4's in subfolders & moving them to master fold

PostPosted: Sat Dec 19, 2020 2:57 pm
by mitchellm
I'm having a hard time following this example, but I think it would be really useful for me. Is it possible for you to post a screenshot of your rule in Hazel? To me this example reads like you are creating 2 or more rules: but that can't be right. As a result I'm failing to see how it's constructed. A visual would make it all clear.

Many thanks in advance.

Re: Finding mp4's in subfolders & moving them to master fold

PostPosted: Mon Dec 21, 2020 11:38 am
by Mr_Noodle
I'm not the original author but it does require two separate rules. I suggest you read the chapter in the manual on subfolders for an explanation why.

Re: Finding mp4's in subfolders & moving them to master fold

PostPosted: Mon Dec 21, 2020 6:22 pm
by mitchellm
Got it. Will do!