Another 'Work in all sub folders question'

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

Moderator: Mr_Noodle

Another 'Work in all sub folders question' Wed Jul 11, 2007 11:41 am • by FOOOD
Great app, but I'm having a little trouble setting up a rule to operate in all sub folders of the main folder I've attached a rule to.
(I've looked at the FAQ & done a search on the forums (honest :) ) but I think because I'm new to Hazel I don't fully understand how it works/what I need to do properly).


I want to have a rule that will add tags (Spotlight comments) to files if they're added to any folder within the main folder that I've added the rule to.

So the first rule I have is:

If: All
Kind - Is - Folder

Do the following:
Run on folder contents


2nd rule:

If: All
Date added - is in the last - 1 minute

Do the following:
Add comment '&mytag'
Send Growl notification (just to let me know it's running OK & tagging the files)


Here's an example of my folder structure:

Main folder (with rule attached) -->Sub Folder 1 (level 1) -->Sub Folder 2 (level 2) -->Sub Folder 3 (level 3)

If I drop a file into the Main folder it will tag the file correctly.
If I drop a file into the Sub Folder 1 (level 1) folder it will tag the file correctly.
If I drop a file into the Sub Folder 2 (level 2), Sub Folder 3 (level 3) folders or deeper it won't tag the files.


Any ideas on how I'd get it work through all the sub folders?
FOOOD
 
Posts: 49
Joined: Thu May 31, 2007 4:29 pm
Location: UK

Wed Jul 11, 2007 11:53 am • by IDontDoWindows
I could be wrong (I'm not terrifically familiar with running rules on folder contents) but if you're processing files, you could get rid of the kind is folder line in the first rule. I think as soon as Hazel sees that whatever item it has is not a folder, it skips that item and goes to the next.
IDontDoWindows
 
Posts: 57
Joined: Sun Jan 07, 2007 5:43 am

Wed Jul 11, 2007 12:29 pm • by FOOOD
I've tried but it doesn't work on sub folders if I remove the 1st rule.
FOOOD
 
Posts: 49
Joined: Thu May 31, 2007 4:29 pm
Location: UK

Wed Jul 11, 2007 12:59 pm • by Mr_Noodle
You have it right for the most part. There's just a subtlety happening here.

Hazel is only watching the top folder for changes so it won't immediately see changes in the subfolders. As a result, when it does run (which could be minutes later) and descend down into level 2 and level 3, the date added may be more than 1 minute ago.

My suggestion is to make it more like 5 minutes or even a whole hour or day. Once it matches, Hazel won't keep running the actions on the same file if it keeps matching (unless you run the rules manually in which case it forces running of the actions). But the point is that you need a larger window of time for Hazel to notice the date added.

There will still be a delay between adding a file in a subfolder and the actions being run but they will be run.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Wed Jul 11, 2007 2:40 pm • by FOOOD
Thanks a lot, setting a longer time works fine.
I guess if it were checking too frequently through quite a lot of folders it would use up a fair amount of resources anyway.

Thanks again :)
FOOOD
 
Posts: 49
Joined: Thu May 31, 2007 4:29 pm
Location: UK


Return to Support