Page 1 of 2

Move Duplicate Instead of Renaming or Deleting

PostPosted: Wed May 06, 2015 4:13 pm
by Zyniker
I have a rule which monitors Folder1 for files and then renames them based on their contents and places the sorted files into Folder2. There will virtually always be an existing file with the same name in Folder2 as the renamed one being moved from Folder1. Of course, Hazel gives the option to rename, replace, or delete the existing file. What I would like to do instead is move the existing file into Folder3 (an archive folder). What is the best way to go about accomplishing this in Hazel?

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Thu May 07, 2015 11:46 am
by Mr_Noodle
There might be a really roundabout way such as:

- Have Hazel rename the file when moving
- In folder 2, if a file exists that has the same name as the file but with a number after it, move the file to archive.
- In folder 2, if the file matches the pattern where it has a dash and number at the end (i.e. when Hazel renamed it), renamed it without the number.

To do the last couple steps, you need to hold down option while clicking the + button to create a new condition. That will create a nested condition. You'd need to do two levels of that, first targeting the enclosing folder, then targeting "any of its subfiles" on that.

Or you can write a script. :P

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Thu Mar 08, 2018 8:49 am
by carver
Hi Mr_Noodle,

I need exactly this - but I don't get it how to set this up.
Can you please explain it maybe with a screenshot?

Would really appreciate your help!

Thanks,
Tom

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Thu Mar 08, 2018 11:25 am
by Mr_Noodle
Can you post the specifics of your case? I find many times people think they are doing the same thing when it's different enough that any solution I provide won't apply.

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Thu Mar 08, 2018 11:35 am
by carver
Sure:

300 pages catalog - 3 versions. So a lot of PDFs.
Renaming, moving, sorting etc. works perfectly with hazel.

But surely there are a lot of changes till the final version of this catalog.
Instead of replacing the older files (ex Page005.pdf) I would like to keep those previous PDF Versions in a backup folder. In the backup folder I don't care if the versioning is -1 -2 ... but the current pdf should be "clean".

I hope you understand my needs :)

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Fri Mar 09, 2018 11:17 am
by Mr_Noodle
What do you mean by "clean" here?

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Fri Mar 09, 2018 11:56 am
by carver
Without any versioning like -1 or _1

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Mon Mar 12, 2018 10:59 am
by Mr_Noodle
I think that would require a script. You basically want is to renumber the previous "clean" version whenever a new one is copied which is logic that is not available now.

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Mon Mar 12, 2018 11:10 am
by carver
Mr_Noodle wrote:There might be a really roundabout way such as:

- In folder 2, if a file exists that has the same name as the file but with a number after it, move the file to archive.


In your first answer you mentioned this method.
How can you set up a rule like this -if a file exists that has the same name-
This is where I got stuck - how can you pass through the file name to another rule?
I think this would help...

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Tue Mar 13, 2018 11:28 am
by Mr_Noodle
Note this will only work if both folders are "close" to each other (like in the same folder). Did you look up "nested conditions" in the manual?

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Tue Mar 13, 2018 11:44 am
by carver
Sure, but as is said - I don't get it :)

I really think your mentioned method would fit my needs.
Could you quickly set up those rules an post a screenshot?
For dummys in this case....

Thanks a lot!

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Wed Mar 14, 2018 10:40 am
by Mr_Noodle
You'll need to post the exact folder structure as any solution is dependent on that.

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Wed Mar 14, 2018 11:16 am
by carver
Catalog_2018
Folder --- Print_PDFs
EN_Page_01.pdf <---- a new Version of EN_Page_01.pdf
Subfolder --- Language01
EN_Page_01.pdf
EN_Page_02.pdf
......

Subfolder --- Language02
Subfolder --- Language03
Subfolder --- Archive

With a previous rule the generated PDFs are sorted into Print_PDFs.
(some steps with renaming, moving around for preflight...)
Next important Step woulb be:
- the new Version of EN_Page_01.pdf should go into Language01
- the Pdf which is already exists in this folder should go into archive

If this would be better, there could also be an archive folder in each language folder.
Doesn't matter.

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Thu Mar 15, 2018 11:08 am
by Mr_Noodle
Still not clear on a few key details. When the old "01" file is moved to archive, what is it named? Also, where are the "02", etc files coming from?

Re: Move Duplicate Instead of Renaming or Deleting

PostPosted: Fri Mar 16, 2018 3:59 am
by carver
Numbers are the pages (Page_01, Page_02 ...).
The naming of the old files moved to archive basically doesn't matter.
Could be hazel standard like -1 -2 -3 - if possible V01 V02 V03.
Would be nice but not necessary