Page 1 of 1

Subfolder/file count only triggers once

PostPosted: Tue Dec 03, 2013 5:09 pm
by cvc1968
I am running the following rule on my user folder (in order to target my Downloads folder):
Code: Select all
If all the following conditions are met
Kind is Folder
Name is Downloads
Sub-file/folder Count is greater than 5
Do the following to the matched file or folder:
Run Applescript...etc


So when the folder receives its 6th item, this triggers as expected. However, adding a 7th item causes nothing to happen. Likewise, adding more items results in no trigger.

If I DELETE all the items from the folder, then add more than 5 back in, then it triggers. But once it triggers and there are more than 5 items, it will no longer trigger.

I want it to fire off my applescript every time a new item is added and the count of items is greater than 5.

There must be some kind of flag in Hazel that says "I've already triggered this and since the count is STILL more than 5, there is no reason to trigger it again." Is there some way to clear such a flag along with (or within) my applescript, so that the actions will trigger every time a new file is added?

Thanks.

Re: Subfolder/file count only triggers once

PostPosted: Wed Dec 04, 2013 1:28 pm
by Mr_Noodle
Try adding a condition like "Date modified is after date last matched" which indicates it should match when the folder has been modified (files added or deleted) since last time.

Re: Subfolder/file count only triggers once

PostPosted: Fri Dec 06, 2013 1:10 pm
by cvc1968
Thanks. That put me on the right track...

Here is the final recipe that does what I wanted:

Code: Select all
If all the following conditions are met
Kind is Folder
Name is Downloads
Sub-file/folder Count is greater than 5
Date Last Matched is before Date Last Modified
Do the following to the matched file or folder:
Run Applescript...etc