Move Duplicate Instead of Renaming or Deleting

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

Moderator: Mr_Noodle

Not sure if this will work but have Hazel monitor the Print_PDFs folder and Language folder separately. Actually, because of some subtleties, it would be better Print and Language folders be siblings instead of one being a subfolder of the other. The following examples will assume this:

In the Print folder you want to use something like:
Code: Select all
   If (all) are met
       <<<<conditions to match the new pdf file>>>>
       If (all) are met for (its enclosing folder)
           If (all) are met for (any of its sub-files/folders)
               Kind is Folder
               Name is Language01
               If (none) are met for (all of its sub-files/folders)
                   Name matches (name)
    Sort into subfolder Language01

What this does is match the new pdf file (as noted, you have to add the conditions to determine this), sees if there is a file with the same name under the Language01 folder. It only copies if no file with that name exists.

Now with the Language01 folder, you would have something like:
Code: Select all
    If (all) are met
        If (all) are met for (the enclosing folder)
           If (all) are met for (any of its sub-files/folders)
               Kind is Folder
               Name is Print_PDF
               If (all) are met for (any of its sub-files/folders)
                   Name matches (name)
    Move to Archive

This checks if there's a file in the Print folder with the same name and moves it to archive. The first rule above won't fire until this one does first.

Take some time to understand the above as it is a bit tricky.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks!
Tried, but the third condition is not available:
Image

Next thing to check if this "static" file is moving around correctly:
The first 3 number are changing, as those are the single pages.
I would try to set name with variables. But this is the next step.
carver
 
Posts: 12
Joined: Thu Mar 08, 2018 8:44 am

Oh right, that currently is not available. The issue is that the resource usage could explode by a huge factor if you nest multiple sub-file targets. I'm afraid that in that case you will have to use a script.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks anyway!

Maybe another option for If the file exists:
If file exists:
- rename the file (with a field for a individual versioning)
- rename the existing file (field)
- replace the existing file
- throw away the file

With this you could search for this individual versioning and send those files to archive.
carver
 
Posts: 12
Joined: Thu Mar 08, 2018 8:44 am

Can you show an example file going through this as I'm a bit unclear on which file is which in your description.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

What I meant was:
If you set the Rule: "Move" to folder "xy" -> in the option-panel add another option.
Now you can choose between:
If file exists:
• rename the file
• replace the existing file
• throw away the file

My feature request was:
Add another option to this panel:
• rename the existing file

A little bit off topic another feature request:
We use hazel really heavy and this little window has become confusing because of those 30+ rules.
Would be great to combine some rules in to folders/groups (e.g. CustomerA, CustomerB, Office....)
carver
 
Posts: 12
Joined: Thu Mar 08, 2018 8:44 am

Thanks for the clarification. Will consider this for a future release.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Previous

Return to Support