Spotting repeated paragraphs

Is there a way of getting Libre Office Writer to recognise repeated paragraphs? I’ve come across an old thread that mentions some Basic and/or Python code here:

https://forum.openoffice.org/en/forum/viewtopic.php?t=54995&p=241710#p241076

But not being a coder I’m not sure how to try it out. The thread seems to imply that the code is applied via a Macro. If so, does anyone know how?

Thanks.

On the same forum where you found the solution, in the Tutorials section there is a separate thread How to install a code snippet

Test if it can be done with this extension

As far as I remember, in that discussion it was said
image
I don’t think anything has changed in 12 years

1 Like

In case you decide for python…apso.oxt helps you to manage code-snippets in python

…except the code!

12 years later I would use:

def remove_duplicate_paragraphs():
    doc = XSCRIPTCONTEXT.getDocument()
    text = doc.getText()    
    paras = set()   
    for paragraph in text:
        if (p:=paragraph.String) in paras:
            paragraph.dispose()
        else:
            paras.add( p )
1 Like

Thanks for the help guys.