How to apply a rule to only new files in a directory?

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

Moderator: Mr_Noodle

I am trying to create an automated workflow where every new file in my Downloads directory gets moved into a directory for the current day. This way, I can easily see all of the files downloaded on a particular day just by going to that day's directory. I created a Hazel rule which matches any file and then uses the "Sort into subfolder" action with the current date pattern. However when I tested it out just now it seems like it moved my entire existing Downloads files into a new directory for today. I guess it makes sense this would happen since my filter was "Any File", but is there a way to force Hazel to ignore already-existing files in the directory and only run my rule on *new* files that are added to Downloads?
ss62
 
Posts: 2
Joined: Sun Jun 04, 2023 8:56 pm

Using current date may not be the best thing to use. How about using Date added instead?
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hi Mr_Noodle - thanks so much for the suggestion. I just tried that and realized that the "Date Added" got reset to the current date for all my files in Downloads/ when I moved them back to the top-level Downloads/. It also seems like that still applied it to all of my existing files in my Downloads/ folder - I am still wondering if there's a setting to have it only apply to newly Downloaded files and ignore whatever files are currently in Downloads?
ss62
 
Posts: 2
Joined: Sun Jun 04, 2023 8:56 pm

Something like "Date added is after date last matched" should only match the first time Hazel encounters the file. But you can't really do much about the date added being reset if you add the file to the folder again.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

ss62 wrote:I am trying to create an automated workflow where every new file in my Downloads directory gets moved into a directory for the current day. This way, I can easily see all of the files downloaded on a particular day just by going to that day's directory. I created a Hazel rule which matches any file and then uses the "Sort into subfolder" action with the current date pattern. However when I tested it out just now it seems like it moved my entire existing Downloads files into a new directory for today. I guess it makes sense this would happen since my filter was "Any File", but is there a way to force Hazel to ignore already-existing files in the directory and only run my rule on *new* files that are added to Downloads?


Could you apply it to any file except for folders? (Since folders will have been created for each day and filled with each day's files?)
MrSeagull
 
Posts: 36
Joined: Tue Jun 07, 2016 8:26 am

You can always add a condition to match (or not match) folders.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support