Find duplicate file in subfolder and replace existing

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

Moderator: Mr_Noodle

Hi,

I apologise if this query is addressed in a previous post.

I have a folder of PDFs (generated and maintained by Endnote (a reference management application)) and Endnote sorts specific PDFs into arbitrarily named subfolders within the main 'PDF' folder (let's call it 'FldrA').

I am currently using Hazel to monitor FldrA and then to copy any new PDFs (run on the contents of FldrA and therefore all of its subfolders) to a separate folder (let's call it 'FldrB')(synced to Google Drive). This is working very well.
I then get Hazel to monitor FldrB and sync any recently modified PDFs back to FldrA. Ideally I would like the PDFs to be synced into their appropriate subfolder (where the original PDF exists), but at the moment it just syncs them into FldrA itself, not the individual subfolders.

So what I am trying to achieve now is to have Hazel monitor FldrA and search for any duplicates within it and it's subfolders and replace the PDF in the subfolder with the more recent version in FldrA itself (i.e. scan for duplicates and move the more recent PDF version into the existing (but arbitrarily named) subfolder, replacing the older PDF version, and therefore only have the more recent PDF, and that being located within its subfolder).

Is this possible? (From looking at Hazel's options / possible rule attributes, I presume either an AppleScript or Automator workflow may need to be involved? (I don't have any experience with AppleScripts or Automator workflows)).

Thanks.
wp1515
 
Posts: 2
Joined: Wed Apr 15, 2015 7:58 pm

Are you trying to do a bidirectional sync? If so, I would recommend using some other tool for that, one which works interactively so you can handle conflicts. Otherwise, I'd need to see your rules to advise you on this.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

In essence, yes it is a bi-directional sync, but Hazel seems to be able to currently sync to the parent folder (no concern regarding confilcts there because Hazel does that correctly, based on date last modified).

My aim is to now have Hazel find the duplicate file that is inside one of the arbitrarily-named subfolders (located inside the parent folder) and move the parent folder file into the duplicate file's subfolder (and overwrite the subfolder file).

Does this seem like something that Hazel can do?

Thanks.
wp1515
 
Posts: 2
Joined: Wed Apr 15, 2015 7:58 pm

Seems like you need a script to do that. You can't really have a rule try and match conditions on a file in a totally different place.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support