Moving all video files to top level folder

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

Moderator: Mr_Noodle

Moving all video files to top level folder Sun Jul 18, 2021 12:35 pm • by marcus
Hi all,

I've read through the forums about having Hazel move through subfolders, but I am stuck on how to create a set of rules that will essentially do a simple task.

I've created a monitor folder. The goal of this folder is to process other folders which contain a number of different subfolders which contain different file types (text, video, photos, music, etc.).

When a folder is placed into my monitor folders (called "Clean Folders") I want all of the video files to be moved to the top level folder and the rest of the files and subfolders deleted. Effectively I want to preserve the name of the folder moving into my "Clean Folders" monitor, but I want all the contents OTHER THAN the movie files to be put in the trash.

I wonder if I am overcomplicated this or if I'm just not thinking about the logic of the rules correctly. I've tried a number of different rules which have gotten me somewhere, but not totally there. For example, I've tried to have the video files keep moving into the enclosing folder until they get to the top folder. But since hazel will not loop rules (or at least I haven't figured this part out) it will not keep moving up the enclosing folder structure until I get to the top folder.

Any help with this would be much appreciated!
marcus
 
Posts: 9
Joined: Sun Oct 27, 2019 1:07 pm

One of the destinations of the "Move" action is "monitored folder". Unless I'm missing something, that should do what you want.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Moving all video files to top level folder Mon Jul 19, 2021 1:32 pm • by marcus
Mr_Noodle wrote:One of the destinations of the "Move" action is "monitored folder". Unless I'm missing something, that should do what you want.


Yes, I don't want the files in the monitored folder. I want them in the original folder that they were moved with into my monitored folder.

Folder A - Contains a collection of movie, music, photo, and text files that are in subfolders (varying depths).

When I move Folder A into my monitored folder, I want Folder A to contain only movie files, but I do not want those movie files to move into the monitor folder. There should be many other folders within the monitored folder. The goal is not to have any video files into the monitored folder, but contained at the top level of their original folder.
marcus
 
Posts: 9
Joined: Sun Oct 27, 2019 1:07 pm

Can you post a specific example as I'm not quite following?
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Moving all video files to top level folder Tue Jul 20, 2021 1:53 pm • by marcus
Its hard for me get any more specific of an example so I'll use a stock photo I found online to help. Please ignore the arrow and text beside the photo.

Image

Let's say that the "Project" folder here is my monitored folder. Any folder that is moved into this folder has rules applied to it.

My goal is to take every MOVIE file from all those nested subfolders and move them to Folder 2—not to the monitored folder (i.e. "Project")—and have the rest deleted. The end result should produce Folder with a bunch of movie files (previously nested in subfolders) at the top level of Folder 2.

Essentially, I've created a rule to try to move the movie files the ladder so to speak and stop right before they get put into the monitored folder, but since Hazel doesn't loop rules, it only goes up one level. Sometimes this is fine if the subfolder depth is only 1, but if the folder I want to clean has multiple layers I have to run the rule more than once.
marcus
 
Posts: 9
Joined: Sun Oct 27, 2019 1:07 pm

Thanks for the clarification. Not sure if there's a good way to do this without using a script unless you have some other way to correlate the movie files with that folder (like if the folder name is somehow matches some other metadata in the file).
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support