how to find duplicate paragraphs in a document?
Is is possible for Pages to scan a lengthy document to find duplicate paragraphs?
Is is possible for Pages to scan a lengthy document to find duplicate paragraphs?
Try this script:
tell front document of application "Pages"
set paraList to {}
repeat with aParagraph in paragraphs of body text
tell aParagraph
if (it as text) is in paraList then set its color to "red"
set end of paraList to it as text
end tell
end repeat
end tell
This should turn duplicate paragraphs red.
(If the script doesn't seem to be running, make sure Script Editor is listed and checked at System Preferences > Security & Privacy > Privacy > Accessibility.)
SG
Try this script:
tell front document of application "Pages"
set paraList to {}
repeat with aParagraph in paragraphs of body text
tell aParagraph
if (it as text) is in paraList then set its color to "red"
set end of paraList to it as text
end tell
end repeat
end tell
This should turn duplicate paragraphs red.
(If the script doesn't seem to be running, make sure Script Editor is listed and checked at System Preferences > Security & Privacy > Privacy > Accessibility.)
SG
Not without outside assistance.
That assistance can come from the user supplying a phrase to the Find / Replace with feature that, if detected at more than a single location in the document, would indicate the possibility of a duplicate paragraph.
Or it could come from an Applescript that reads and stores the first few words of each paragraph, compares them with the strings it has already saved from previous paragraphs, and flags, or otherwise gives notice of a posible duplicate.
The script would have the advantage of reducing user activity to starting the script, reading the results, and acting on those results.
There are a few talented script writers participating in these communities. With luck, one will read this thread and take on the exercis of writing this script.
Regards,
Barry
"It’s a shame Apple doesn’t"
Hi Casualina,
Use the Provide Pages Feedback menu item in the Pages menu to send Apple a Feature Enhancement request.
Here, you are in a user-to-user community, where Apple's participation is minimal, and does not usually include participation by product development team members.
Regards,
Barry
Hi Viking,
Or in Pages, select some words in a paragraph that is suspected of duplication. Copy, then
Menu > Edit > Find > Find... (command F)
and Paste in the Find Box.
Click on the right arrow ">" to show all matching text that is found.
Regards,
Ian.
Due to MS Word having a great many handy features that corporations have required over the near 40 years of its evolution when a particular feature does not appear in Pages, I may recommend one of these alternatives:
In LibreOffice v7.1, all one has to do is select an entire specific paragraph that is suspected of duplication. Click Edit menu > Find and Replace, and then click the Find Next button. This will select the next duplicate paragraph, and one can press backspace to remove it or take some other action on the duplicate paragraph. I suspect with appropriate regular expression syntax, one can tell it to take action on a specific capture instance.
Thanks, Barry. When I googled this question it seems that other programs such as Word does have this capability. It’s a shame Apple doesn’t
.
Hi VikingOSX,
Happy to see you in this conversation (and others, of course).
I did check the LibreOffice site for possible instructions on this task. Vast quantities of documentation, but a search for 'find duplicate paragraphs' didn't turn up much n the way of useful information. There was a link to LO's community forum, but there the most topic connected post was one with a link to "the other forum," which, when clicked led to the ApacheOpenOffice community forum, where there was a series of posts on "How to Find Duplicate paragraphs," including two with scripts. One appeared to be a 'native environment' script for .odt files, the other was a script using perl.
Has 'find duplicate aragraphs' become a built in feature of LibreOffice, or does it still require a script?
And turning to Pages, could this be accomplished with a script?
Regards,
Barry
HI Viking,
"In LibreOffice v7.1, all one has to do is select an entire specific paragraph…"
That may explain why I didn't find a reference to it in the documentation I found on the LibreOffice site—it was updated only to version 6.4.
Regards,
Barry
how to find duplicate paragraphs in a document?