Duplicates in a smart group or in a new folder

I’m still new with DevonThink, so I might need some help if possible.

I have all my e-mails from Outlook imported and also from an old backup. How can I scan my database for duplicates and put them automatic in a new smart group called duplicates ? So I can check them from that smart group and then delete them… ?


There should be a default smart group “Duplicates” in the Smart Groups section of the sidebar but you could also add a new smart group to your database and use the condition Item is Duplicated.

Great ! That’s the solution - many thanks :slight_smile:

Sorry, just one extra question : is there a script that I can run in the future to search in a particular database for duplicates ?

You could create a new smart group or duplicate the existing ones and change the search scope (see Search In popup of smart group editor).

I’m not sure what you mean what I should do ? Is that a smart rule ? Or could you help me with some steps I should take ?

  1. Create a new smart group e.g. via the contextual menu
  2. Add the condition Item is Duplicated
  3. Set the search scope via the Search In popup

Like this ?

But how to run the script to search the database for duplicates ?

All you have to do is to select the created smart group and it will show its contents like a regular group.

OK, thanks.

And if it is highlighting for example 3 duplicate e-mails - I can delete all 3 ? Or only 2 ?

You shouldn’t delete all of them, e.g. in case of two identical duplicates you would have to delete one. Or you could just select the results of the smart group and use Scripts > Data > Move Duplicates to Trash which handles this automatically.

I imported some 200 emails into a database where without realising it copies of those emails already existed. Normally when I try to do that only new emails are entered and the rest are rejected. This time all 200 were accepted so I have 200 duplicates. Is there a quick way in DT3 to identify and delete the duplicates to save me wasting an hour of my life doing this manually?

Use the Duplicates smart group.
Select the duplicates and use the Script menu > Data > Move Duplicates to Trash script.

Thanks for your reply. I followed your instructions and nothing happened. Is there anything that I should have done prior to selecting the duplicates etc?

See page 232 of the DEVONthink Manual. Same in “help”. It says “Move Duplicates to Trash: Moves all duplicates of the selected document to the trash.”

So, just a hunch here, need to select some documents.

Interesting! I’ve just tried that on another database and it worked perfectly. However on the database the subject of my previous post, having looked carefully at the files marked as duplicates in the relevant folder, although they are marked as duplicates, there are no duplicates of the relevant files in that folder so I assume that DT3 has picked up duplicates within other folders in that database but because they are in a different folder doesn’t deal with them. Does that figure?

I’m not sure if I understand what you want to say. If it is “does DT consider duplicates across groups, but not databases?”, then the answer is “yes”. File A in group a and File B in group b will me marked as duplicates if they are similar “enough”.

OK that answers part of my query. In those circumstances I would expect that if I highlight several files marked as duplicates in group A when there are no actual duplicates contained there, so they would be in another group within the database, and go through the process of deletion then one or other of the duplicates would be deleted and the duplicate icon would disappear? That’s not happening. Any other suggestion?