Copy link to clipboard
Copied
Hey there,
I was wondering if it exists a plugin or a GREP code i could use to spot duplicate paragraphs in a indd document. thank you!
Copy link to clipboard
Copied
Do you mean sequential duplicates, one after the other, or ones that might be anywhere in the document? The first is trivial, even without a script or such, but the second approaches low-grade AI, I think.
If this is something you have to do a lot, a script could probably be found or created. If it's a one time thing, or an infreequent one, I'd just use Find/Change set to find the end of each body text paragraph. (Limit it to the body text style, by name, and search for Paragraph End+Any Character — ^p^?. This will find only body content and skip last paragraphs, and should position the cursor/view right at the beginning of each paragraph.)
Then just search through, one quick click per paragraph, and watch for identical beginnings. This will be tedious, but you can be done with it in less time than tinkering a script or elaborate search into working correctly.
—
Copy link to clipboard
Copied
Hi @-BOZ-:
Showing us an example or two would be helpful. In the meantime, I found these two posts on the topic. Do either help?
~Barb
Copy link to clipboard
Copied
A fun exercise. A very rudimentary approach might be:
var ps = app.activeDocument.stories.everyItem().paragraphs.everyItem().contents.sort();
var i = ps.length -1;
var msg = "";
var c;
var count = 0;
while (i--) {
c = ps[i];
if (!c) continue;
if (c == ps[i+1]) {
msg += c + "\n";
count++;
}
}
alert(count + " dupes found:\n" + msg);
Obviously would need lots of refinement, and would probably take forever on a long doc.