How to get Hazel to go into subfolders

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

Moderator: Mr_Noodle

How to get Hazel to go into subfolders Fri Jul 06, 2012 3:02 pm • by robwired
I'm reposting this question as a new topic as per the moderator's request:

I'd really like to use this functionality in the most basic way but it's just not working.

I have successfully set Hazel up to watch a folder and to move files that match a condition to move to another folder on my system.

Here is what I have happening on a folder on my system named Torrents

Name: Television- Avengers (avi)

if all of the following conditions are met for the file or folder being matched
Name contains Avengers
Extension is avi

Do the following to the matched file or folder:
Move to folder Avengers

This works 100%.

Where I am having a problem is when I set up to Watch for Subfolders as an additional rule prior to the above rule.

Name: Watch for Subfolders
If any of the following conditions are met for "the file or folder being matched" or "all of its sub-files and folders"

Kind is folder

Do the following to the matched file or folder:
Run rules on folder contents.

As above, I have tried both settings of "the file or folder being matched" and also "all of its sub-files and folders" and neither is working.

It gets worse. If I have this rule loaded then my primary rule stops working for files that go into the Torrents folder as well.

In order to get that rule working again I have to uncheck or remove this rule and then reboot my system.

I'm on version 3.0.8. Is this a bug, something that might be fixed in an update or am I doing something wrong?
robwired
 
Posts: 5
Joined: Thu Jul 05, 2012 3:00 pm

Re: How to get Hazel to go into subfolders Fri Jul 06, 2012 3:03 pm • by robwired
As as addition I have tried both settings of "the file or folder being matched" and also "all of its sub-files and folders" and neither is working.
robwired
 
Posts: 5
Joined: Thu Jul 05, 2012 3:00 pm

Re: How to get Hazel to go into subfolders Fri Jul 06, 2012 4:27 pm • by Mr_Noodle
Please follow the advice I posted in the other thread. The troubleshooting article near the top of this forum should narrow things down. If it still doesn't work, please specify where things are failing in the steps outlined in that article.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: How to get Hazel to go into subfolders Fri Jul 06, 2012 5:38 pm • by robwired
Hi,

I've very carefully followed your advice from the troubleshooting article and that's why I've written such a detailed post here.

I tried to be extremely clear where it's failing...

As I stated, I tried both settings within Watch for Subfolders:

Name: Watch for Subfolders
If any of the following conditions are met for "the file or folder being matched" or "all of its sub-files and folders"

Kind is folder

Do the following to the matched file or folder:
Run rules on folder contents.


I've written my exact rules... as well as the problem where it fails with the watched folder.

Unlike the rest of Hazel this is just beyond difficult. Maybe instead of treating this like a computer code issue it might make sense to simply change how Hazel displays this feature.

For example, instead of making a cumbersome rule, maybe a checkbox someplace to determine whether to go into sub-folders?

Anyway, I'm okay with the cumbersome and difficult rules, but I just need help to get them to work.

Could you please just tell me what is wrong with my rule of watched folders? I tried both of them. Since my rules are working on the main folders I'm really confused as to why this simple rule isn't working for sub-folders.

Name: Watch for Subfolders
If any of the following conditions are met for "the file or folder being matched" or "all of its sub-files and folders"

Kind is folder
robwired
 
Posts: 5
Joined: Thu Jul 05, 2012 3:00 pm

Re: How to get Hazel to go into subfolders Fri Jul 06, 2012 7:45 pm • by a_freyer
Alright, what you're describing sounds accurate. I understand your frustration. I will go through the process for your particular situation as best I can as clearly as I can so that perhaps you can find the missing step.

Here we go.

(1) Looks like you have a "Torrent Downloads" folder under which various subfolders will be created that will contain the video file:

The Folder:
/Torrent Downloads/

Currently Contains:
/Torrent Downloads/Download_12345/My Legally Downloaded Video.avi
/Torrent Downloads/Download_67890/Another Awesome Legally Downloaded Video.avi


(2) Hopefully we're still on the same page. Now, what you want to do is to move these videos to another folder, yes?

The Folder:
/Movies/

Will Contain:
/Movies/My Legally Downloaded Video.avi
/Movies/Another Awesome Legally Downloaded Video.avi


(3) Ok, now Hazel is built for this. You're going to need several rules:

Code: Select all
- Rule # 1 - Dive into Subfolders of Torrent Downloads
- Target: This rule monitors the "Torrent Downloads" Directory
- Name: Torrent Downloads

if (all) of the following are true for (the file or folder being matched)
    kind is folder

then
    Run rules on folder contents


Code: Select all
- Rule # 2 - Move my movies
- Target: This rule moves movies
- Name: Movie Mover

if (any) of the following are true for (the file or folder being matched)
    kind is movie

then
    move file to /Movies/


It'll look like this:
Image
Image
Image

Then when we get a new file:

Image

It shows up as ready to move:

Image

And Hazel moves it right away.


If it were me, I'd also include this:

Code: Select all
- Rule # 3 - Delete Empties
- Target: This rule deletes empty folders
- Name: Remove Empties

if (any) of the following are true for (the file or folder being matched)
    kind is folder
    size is 0

then
    move file to Trash


I hope this helps.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: How to get Hazel to go into subfolders Fri Jul 06, 2012 9:20 pm • by robwired
Hi,

This seems to best if I have only the two rules in the rules folder which I tested by creating the rules around a new folder but when I then added additional rules to cover other tv shows it takes a really long time.

When I choose Run Rules and select the folder it does work quickly.

I assume that for each rule added it takes time for the system to process then? Could that explain the delay?

I'd just like to know it's going to be reliable.

Maybe I could reduce the rules by consolidating some of the rules.

Is there a way to add multiple tv shows to a rule so that I don't have 21 different rules?

Or would there be a way to make it work with more than one extension?

I currently have it set up like this:

Rule 1
Name contains Avengers
Extension is .avi

Rule 2
Name contains Avengers
Extension is .mkv

Rule 3
Name contains Avengers
Extension is .mp4

Then I have the same exact rules for each television show.

If I could consolidate these would that help with the processing speed?

I'm on new 2012 Mac's so I don't think it's a processing power issue.
robwired
 
Posts: 5
Joined: Thu Jul 05, 2012 3:00 pm

Re: How to get Hazel to go into subfolders Fri Jul 06, 2012 9:29 pm • by a_freyer
robwired wrote:I currently have it set up like this:

Rule 1
Name contains Avengers
Extension is .avi

Rule 2
Name contains Avengers
Extension is .mkv

Rule 3
Name contains Avengers
Extension is .mp4


Well, you can do it like this:
Code: Select all
if (all) of the following are true for (current file or folder)
   Name Contains Avengers
   If (any) of the following are true
       extension is mkv
       extension is avi
       extension is mp4

Then
      ....


In order to get a hierarchy of rules, hold OPT and you'll see a (...) appear where the (+) used to be on the matching line.

Also, you should just do what I did in my previous example... just say Kind is movie that will loop in all your extensions for you.

More importantly... is your setup working now? Did my tutorial help you figure out what your issue was?
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: How to get Hazel to go into subfolders Tue Jul 10, 2012 2:51 pm • by Mr_Noodle
A few things.

Do not use "any subfiles" for this. Just erase that from your mind.

Also, you have not mentioned (a) whether it looks correct in the preview and if it does (b) if there are any errors in the logs. Both of those are covered in the troubleshooting article. If you are having this much trouble then you should consider emailing me at support with your rules, screenshots of your preview and an excerpt from your logs.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: How to get Hazel to go into subfolders? Mon Aug 13, 2012 7:25 pm • by geegovah
I am trying to set up a rule ultimately that will add a set openmeta tag to a folder. Many folders have subfolders so I need to run the "Go into subfolders" rule accurately. For the moment I am experimenting by seeing if I can set a colour to all files and subfolders and their files. I have downloaded and imported your rule 'as is' simply adding Set color label to green. Problem: the only items that get coloured are the folders and subfolders but not any of the files within those folders. What am I doing wrong?
geegovah
 
Posts: 16
Joined: Mon Jun 11, 2012 6:05 pm

Re: How to get Hazel to go into subfolders Tue Aug 14, 2012 3:08 pm • by Mr_Noodle
I can't say for sure without seeing your rule but my guess is you are not reading the article. There is a picture with a red X through it showing that you should not be combining rules into one where it doesn't make sense. Please read the article again, making note of that section.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: How to get Hazel to go into subfolders Tue Aug 14, 2012 5:47 pm • by geegovah
Dear Mr Noodle,

Thank you for your reply. Here is my rule.

If all of the following conditions are met for the file or folder being matched

Kind is folder

Do the following...

Run rules on folder contents

Set color label red

That's it! It's a straight copy of your rule with my variation, adding one rule to colour the files, but the only thing that gets coloured is the folder, not its contents.

Your help is appreciated.
geegovah
 
Posts: 16
Joined: Mon Jun 11, 2012 6:05 pm

Re: How to get Hazel to go into subfolders Wed Aug 15, 2012 11:23 am • by a_freyer
Your rule is set up to only color the folder. Read your rule from top to bottom - it says: IF folder, THEN color red and run the other rules for the parent folder on this matched folder's contents. You should remove this coloring activity to its own separate rule.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: How to get Hazel to go into subfolders Sun Feb 24, 2013 8:32 am • by IeUz
Greetings,

sorry for the bump.

But the rule i am trying to create is very similar to this one.

What i am trying to do is the following.

color a folder green if it has been modified today
then look inside folder and color files based on dates, green if has been modified today, yellow if this week.

Code: Select all
if file/folder has been modified today
  then color it green
if file/folder is of type folder
  then apply rules to its folder contents
if file/folder has been modified today
  then apply color green
if file/folder has been modified this week
  then apply color yellow


The problem i come is the following.

Once the first rules has been met, then Hazel wont go inside that folder and color its files.
If first rule has not been met, then yes, Hazel go inside and color its files.

Image

My rules: https://dl.dropbox.com/u/425150/My%20rules.hazelrules

How can i solve this problem?
Is it possible at all?

Thank you!
IeUz
 
Posts: 1
Joined: Sun Feb 24, 2013 8:14 am

Re: How to get Hazel to go into subfolders Mon Feb 25, 2013 4:04 pm • by Mr_Noodle
Try adding "Run rules on folder contents" to the first rule as well.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

a_freyer wrote:Alright, what you're describing sounds accurate. I understand your frustration. I will go through the process for your particular situation as best I can as clearly as I can so that perhaps you can find the missing step.

Here we go.

(1) Looks like you have a "Torrent Downloads" folder under which various subfolders will be created that will contain the video file:

The Folder:
/Torrent Downloads/

Currently Contains:
/Torrent Downloads/Download_12345/My Legally Downloaded Video.avi
/Torrent Downloads/Download_67890/Another Awesome Legally Downloaded Video.avi


(2) Hopefully we're still on the same page. Now, what you want to do is to move these videos to another folder, yes?

The Folder:
/Movies/

Will Contain:
/Movies/My Legally Downloaded Video.avi
/Movies/Another Awesome Legally Downloaded Video.avi


(3) Ok, now Hazel is built for this. You're going to need several rules:

Code: Select all
- Rule # 1 - Dive into Subfolders of Torrent Downloads
- Target: This rule monitors the "Torrent Downloads" Directory
- Name: Torrent Downloads

if (all) of the following are true for (the file or folder being matched)
    kind is folder

then
    Run rules on folder contents


Code: Select all
- Rule # 2 - Move my movies
- Target: This rule moves movies
- Name: Movie Mover

if (any) of the following are true for (the file or folder being matched)
    kind is movie

then
    move file to /Movies/


It'll look like this:
Image
Image
Image

Then when we get a new file:

Image

It shows up as ready to move:

Image

And Hazel moves it right away.


If it were me, I'd also include this:

Code: Select all
- Rule # 3 - Delete Empties
- Target: This rule deletes empty folders
- Name: Remove Empties

if (any) of the following are true for (the file or folder being matched)
    kind is folder
    size is 0

then
    move file to Trash


I hope this helps.


First of all I apologise for my newbie-ness, first time user and I absolutely love it!
However..
I have been looking for this "so easy I can't possibly see it" function for hours on the support page (through posts and related parent folder search tags) and I still can't find it; I apologise it it has been answered many times before :D.
I have finally wrapped my mind around diving into sub-folders and back out but how can I tell Hazel to move the parent folder (e.g. Download_12345 & Download_67890) to another folder after it detected that it contains kind .avi files?

And that's about it.
call_me_venom
 
Posts: 3
Joined: Sun Feb 22, 2015 6:23 pm

Next

Return to Support