Duplicate File Finder Automation

I'm looking for the same thing as topic [url]Duplicate file finder] but with a twist...

I'm interested in finding out if one can enumerate through the duplicate files found going through each group.

If I could get hold of the duplicate list, I want to select the file that has the latest date and then make a hard link to all the other files automatically (Which I can't believe there's no tool out there to do this already).

Of course, I'll probably run into the issue of determining whether a file already has a hard link, so that would be part 2 of my question.

I have Link Shell Extension installed, so can I access the "Reference" value of each file, assuming I can enumerate through the duplicate files.

If you use Delete mode and sort by date (and click the Select button if needed to update the selection after changing the sort order), you'll have a list of files where the newest or oldest (depending on which direction your date sort is in) in each group of duplicates is not selected and the other duplicates are selected.

You could then write a script which goes down the file list and replaces each checked file with a hardlink to the first unchecked file above it.