Keep duplicate based on <rule>

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

Moderator: Mr_Noodle

Keep duplicate based on <rule> Sat Mar 23, 2019 6:15 pm • by Breki
I've got a scenario that I'm unable to recreate, so I'm wondering if anybody else has an idea for this.

Say I've got a rule that scans a directory and its subdirectories, and if a file matching a specific criteria is detected, that file is moved to the root folder. So far so good, I'm able to do this with no problem. The files are moved, empty directories are deleted, everything works just hunky dory.

The problem comes when there's a file being moved to the root that has the same name as a file already in the root. What I want to do is to be able to define rules for which of the two to keep, things like "keep the one with the largest filesize" or "keep the one with the most recent created date" etc.

Any ideas?
Breki
 
Posts: 1
Joined: Sat Mar 23, 2019 4:26 pm

Re: Keep duplicate based on <rule> Mon Mar 25, 2019 11:02 am • by Mr_Noodle
No clear way to do that now in a general way. You'll probably have to use a script.

You might be able to concoct something after the fact is you have Hazel renumber instead of replace files. If you use a nested condition, you can target it to sibling files in the same folder.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron