Page 1 of 1

Trying to create rule to move all but oldest in a folder

PostPosted: Mon Jan 11, 2021 3:05 pm
by dzg
Consider this structure:
Code: Select all
Project1
  Exports
    Version3
    Version2
    old
      Version1
Project2
  Exports
    Version11
    Version10
    Version9
    old
      Version8
      Version7
      Version6


I want a rule that will move all but the newest version of a file within an "Exports" folder to the "old" subfolder of that particular Exports folder. I.e., keep only the most recent version and move the rest into "old".

(Assume that each Version file with a higher number in name also has a more recent creation date.)

I.e., after processing it should look like this:

Code: Select all
Project1
  Exports
    Version3
    old
      Version2
      Version1
Project2
  Exports
    Version11
    old
      Version10
      Version9
      Version8
      Version7
      Version6


I thought I could use the "is not among the" (most recent) but that is not working.

I read the explanation about nesting "among" rules but that doesn't seem to apply. I think it's looking at ALL files in ALL exports folders.

Is this possible with Hazel?

Re: Trying to create rule to move all but oldest in a folder

PostPosted: Tue Jan 12, 2021 11:19 am
by Mr_Noodle
Do you have a subfolders rule? If not, then you need to add that to get Hazel to get to the export folders in the first place. Also, try using the rule status feature as that will give you a better sense of how rules are matching.

Re: Trying to create rule to move all but oldest in a folder

PostPosted: Tue Jan 12, 2021 3:40 pm
by dzg
Mr_Noodle wrote:Do you have a subfolders rule? If not, then you need to add that to get Hazel to get to the export folders in the first place. Also, try using the rule status feature as that will give you a better sense of how rules are matching.


Yes I have a subfolders rule ... the scanner is seeing the files in question ... but the 'among the most recent' check is not working as I would expect.

Re: Trying to create rule to move all but oldest in a folder

PostPosted: Tue Jan 12, 2021 4:07 pm
by dzg
This is what I've got:

Image

But it's moving ALL the items in '3_Exports' into 'old'

Re: Trying to create rule to move all but oldest in a folder

PostPosted: Wed Jan 13, 2021 10:39 am
by Mr_Noodle
Got your email and am looking into it though I'm running into other issues I need to tackle before I can diagnose this properly.