Script to Convert Duplicates to Replicants?


I searched the forum to see if anyone had created an Applescript that will convert duplicates to replicants, but didn’t see anything.

Anyone have such a thing? Otherwise, I’ll write one as my next script.

Best, Charles

neat idea!



Am I correct in thinking that a replicant can have multiple parents, but a duplicate can have only one?

If that’s not correct, under what conditions can a record have more than one parent? Or if that’s too complicated, under what conditions can a duplicate have more than one parent?

I’m iterating through a list of duplicates, and in order to make replicants in the groups that contain the other duplicates, I think I have to get the parent of each duplicate:

set result to replicate record i to parent 1 of j

The above (I think) is fine if there is only one parent of a duplicate, but if not, I’ll need to iterate through the parents.

Thanks! Charles

A replicant must have multiple parents, otherwise it’s not a replicant.

Only if it’s both a replicant and a duplicate.

Did you ever finish this script? I’d love to have a script to do this.

Yes I did. You can find it here:

It uses some script logging code which you can find here, or simply comment it out:

I used it as a one-shot to swab a bunch of data I imported into DTPO and it worked well. It handles (I think) all the possible cases of replicated-duplicants and duplicated-replicants, but the usual caveats prevail: work on a copy of your data, and don’t blame me if things go bad…

Enjoy! and if there’s something that seems amiss or I haven’t given you enough to go on, lemme know and maybe I can help out.

Best, Charles

Just to say thanks for your script, which works perfectly!
(I omitted the logging functionality.)

Coolio, macula!

Glad it was helpful…

Best wishes, Charles

Excellent script! Thanks so much for making this.

Charles, do you still use this version of the script? If not, i would be thankful if you would share your latest version.

Charles hasn’t been active here for a long time, but DEVONthink Pro includes a Dupes to Replicants script. Install it from the Script menu, More Scripts…

The script is still available at the download link – just click the link you quoted in your own post – and is a very simple script. Is there something specific you are wanting it to do that neither Charles’ script (or the one Greg mentioned) can do?

Thanks for your helpful replies! I have found the script within extras.

I am sure I used the extras script before upgrading to DTPro 3. I can no longer find this script in extras and the link to Charles’ script no longer works. Does anyone have a new script?

I don’t know about the script you mentioned but in the Data menu…

1 Like

Never saw this option, sounds promising. What happens if I apply this to all duplicates (I have 16’537 in a thoughtlessly created database)?

Thank you … I think this is what I was looking for.

I’d suggest to enable the stricter recognition of duplicates before applying it.