"Find similar contents" Applescript not working in DEVONthink 3

Looked inside to fix it and it seems I cannot read the score value for a record (last line of the following code snipped)


try

set theComparison to compare record this_record

if ( count of theComparison) > 1 then

set i to 0

set this_message to “”

repeat with this_result in theComparison

if id of this_result is not id of this_record then

if (score of this_result) < pLimit then exit repeat

I see the score property in the properties pane of Script Debugger but" score of this_resul"t in the expressions pane gives me an empty result.

Any ideas how to fix this?

A simple test was successful here. What did you select before running the script?

Accidentally had only selected a single record.

With more records selected it works. Thanks.

Works with one record here too. What was the selection the first time? A group or a document?

A document. Strangely now it works even with a single document. Maybe I’ve selected a wrong one that had no other similar documents. The script quits silently if no similarities are found.

Btw. I plan to do a script based on your’s that searches all documents in all open databases for high similarity to find duplicate scans of the same document and tag these records as “duplicates”. I need to visually check, whether they are indeed duplicates before I delete one.

You want to compare one document to all documents of all databases or to compare each document to all other documents? The second case would probably be really slow (depending on the size of the databases).