Mark folders with inactive files

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

Moderator: Mr_Noodle

Mark folders with inactive files Wed Nov 07, 2012 1:36 pm • by Flexmeister
Hi.

I'd like Hazel to watch over a folder containing lots of subfolders and mark the ones that I don't access regularly, so I can trim the fat a little.

I have the "If kind is folder, run rules on folder contents" rule in place, but I can't find the relevant meta data for the "If" part of the actual rule.

Under "other" I find "content created", "content created with" and "content changed", but not "content opened".
Am I missing something?
Flexmeister
 
Posts: 2
Joined: Wed Nov 07, 2012 1:22 pm

Re: Mark folders with inactive files Wed Nov 07, 2012 5:51 pm • by Mr_Noodle
Try adding a separate rule to match folders and go by its date last accessed or date last modified, depending on your situation. Also, make sure this rule comes before the rule to go into subfolders.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Mark folders with inactive files Fri Nov 09, 2012 8:30 am • by Flexmeister
Thanks for the reply, but I'm afraid I don't get it.

You mean I should first create a rule to only match folders whose contents have been accessed in, for example, six months, followed by the "If kind is folder, run rules on folder contents" rule, correct?

I don't understand how to do the first one, though. Also, how do I get Hazel to mark (i.e. set the color labels for) the folder, not the files?
Flexmeister
 
Posts: 2
Joined: Wed Nov 07, 2012 1:22 pm

Re: Mark folders with inactive files Fri Nov 09, 2012 12:51 pm • by Mr_Noodle
BTW, I moved this topic to the correct forum. The Tip forum is not for questions.

And, to answer your question, yes. That rule matches folders so the actions will apply to the folders. I suggest playing with it and using the preview function to get a feel for how it works.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Mark folders with inactive files Wed Nov 14, 2012 2:35 pm • by gcoghill
Where is the "Date Last Accessed" criteria found?

I'm trying to run rules that perform actions on the files within sub-subfolders, but it seems if new files are added it does not affect the main parent folder. I swear this worked fine before, but lately my rules are not performing the actions they used to.

My folder structure is: Main > Subfolder 1 > Subfolder 2

Rule sets are attached to the Main folder. When I add new files to Subfolder 2, the following rule is not triggered:

Image

Another rule should be copying .jpg images to a Dropbox folder. Other rules are no longer working as they used to as well. Updated to 3.014 today but this hasn't been working for a few days at least. Just logged out in case there was some OSX issue, no luck.
gcoghill
 
Posts: 290
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Re: Mark folders with inactive files Wed Nov 14, 2012 2:43 pm • by gcoghill
I changed the top criteria to "Any of its sub-files or folders", and Hazel locked up. Worked the second time, but now it locks up when attempting to preview the rule matches.
gcoghill
 
Posts: 290
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Re: Mark folders with inactive files Wed Nov 14, 2012 3:29 pm • by Mr_Noodle
For the lockup, select System Preferences in Activity Monitor and do Sample Process and email me the output.

As for your rule, it won't work as it stands. If you add something to subfolder 2, the date modified on subfolder 1 does not change. If you only want to trigger if files are added to subfolder 2 (or other folders at that level), you should make it so that it always matches at subfolder depth 0 (so it will go into subfolder 1) and then check the date last modified on the folders at the lower depth (as you are already checking their name now).
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Mark folders with inactive files Wed Nov 14, 2012 4:03 pm • by gcoghill
Thanks for the quick reply.

I'm not exactly sure how to accomplish what you are suggesting. Do I need another rule? Not sure how to limit to Date Modified at only the lower depth, since setting folder depth to 0 will allow it to run on all folders?

Here's what I am doing:

Work folder > Client folder > Project 1, Project 2, etc. Rules are applied to the Work folder.

The folders I want to run 'rules on subfolder' for are the Project 1, Project 2 etc folders. I want Hazel to only work with files/folders within the Project XX folders and their subfolders that were modified today.

I must have changed something and forgot what I did, because all of this used to work fine.
gcoghill
 
Posts: 290
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Re: Mark folders with inactive files Wed Nov 14, 2012 4:27 pm • by Mr_Noodle
If I understand what you are trying to do, you basically want something like:
Code: Select all
If (all) met for the file being matched
    Kind is Folder
    If (any) are met for current file
        Subfolder depth is 0
        If (all) are met for current file
            Date last modified is Today
            If (any) are met for current file
                Subfolder depth is less than 2
                Name is _sketches


You may need to tweak the above but that is what I would come up with based on what you've given me so far.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Mark folders with inactive files Wed Nov 14, 2012 6:06 pm • by gcoghill
OK I was not aware I could nest another level deep. But it seems I can't go as deep as you suggested. Here's what I have so far:

Image

I'll do some testing here and see if I can wrap my head around these nested rules. Any idea why the rules were working earlier? What could I remove to make them go into the subfolders to note modification dates of today? I know I didn't have anything this complicated before, and it was all working like a charm.

Anyways, thanks for all the help!
gcoghill
 
Posts: 290
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH

Re: Mark folders with inactive files Thu Nov 15, 2012 3:57 pm • by Mr_Noodle
Ah yes, there's a nesting limit at the moment.

I think it was coincidence if it was working earlier. Like there was a change to the folder higher up at the same time. Also, to make things simpler, just have a rule go into subfolders (all of them) and add the other conditions to the other rules which process the files. It seems it might make more sense anyways to test each file for whether it was modified today, not the folder containing them.

Also, if you are just looking to sync a folder hierarchy, you may want to use the rule I posted here instead: http://www.noodlesoft.com/forums/viewtopic.php?f=4&t=1593&p=6500&hilit=sync+rule#p6500
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Mark folders with inactive files Thu Nov 15, 2012 5:29 pm • by gcoghill
Must have been coincidence. The reason I was having Hazel only test folders that were modified today was to lessen resource use by Hazel, since my folders can get quite large with projects and subfolders. Is this not necessary? Just thought "why process all these old folders since nothing has changed".

I'm actually running quite a few other rules on the folders besides a sync, but thanks for that link. Wasn't even aware of the sync actions. So much functionality in Hazel!
gcoghill
 
Posts: 290
Joined: Tue Sep 18, 2007 8:09 am
Location: Kent, OH


Return to Support

cron