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

From your noodle to other noodles. Talk about ways to get the most from Hazel. Even exchange recipes for the cool rules you've thought up. DO NOT POST YOUR QUESTIONS HERE.

Moderators: Mr_Noodle, Moderators

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 !
scanfile99
 
Posts: 1
Joined: Sun Mar 03, 2019 4:43 pm

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.
mitchellm
 
Posts: 3
Joined: Thu Dec 17, 2020 10:01 am

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.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Got it. Will do!
mitchellm
 
Posts: 3
Joined: Thu Dec 17, 2020 10:01 am


Return to Tips & Tricks - DO NOT POST QUESTIONS