Page 1 of 1

Compare files and archive all but the newest version

PostPosted: Sat Feb 20, 2021 12:04 am
by stormer
Hi,

Adobe After Effects allows me to "increment and save" files which results in a duplicate file with an _n suffix eg. AEProject becomes AEProject_1, then AEProject_2 and so on. After a while it gets messy and so I'd like to automate the process of moving all but the most recent version of AEProject into a subfolder.

Thanks in advance for any pointers.

Re: Compare files and archive all but the newest version

PostPosted: Mon Feb 22, 2021 10:25 am
by Mr_Noodle
Try "<<some date attribute>> is not among the X most recent, Move to <<trash, somewhere else?>>"

Re: Compare files and archive all but the newest version

PostPosted: Mon Feb 22, 2021 10:59 am
by stormer
Mr_Noodle wrote:Try "<<some date attribute>> is not among the X most recent, Move to <<trash, somewhere else?>>"


Oh dear, does this involve scripting? Probably should have mentioned I'm completely new to Hazel and if it is indeed scripting I'd be utterly out of my depth. Is there a sample script around that comes close that I could take a look at and try to figure it out from there?

Re: Compare files and archive all but the newest version

PostPosted: Tue Feb 23, 2021 11:29 am
by Mr_Noodle
Not a script. This is done via the built-in conditions. I just used the angle brackets (<<<>>>) to indicate stuff you need to fill in yourself.

Re: Compare files and archive all but the newest version

PostPosted: Tue Mar 02, 2021 5:47 am
by stormer
Hi, great, that works. Thanks very much.

However, I still can't figure out how to get Hazel to consider only groups of files that share the same name. For instance, in this image it should move only the red highlighted files to the "ARCHIVE" folder. Is that possible?
https://imgur.com/mNB2ofC

Re: Compare files and archive all but the newest version

PostPosted: Tue Mar 02, 2021 11:53 am
by Mr_Noodle
You can add another condition to match by name. If that condition is under the same nesting as the the one I mentioned above, they should be taken in tandem.