Thank you, that would be great! Here’s a Dropbox link:
https://www.dropbox.com/scl/fo/qmbipjryu7euxk27zzq3m/AGL8bMBLEqiFfxa-Q-F1w8Q?rlkey=3wlpe5qygimnmn8istpfxuru8&dl=0
The issue is in the running heads on pages 504β505. On page 504 one of the text frames is locked and the other is unlocked. On page 505 both of them are unlocked.
The problem is locating the duplicate text frames, so we could see where they are and decide what to do. In our design text frames should never overlap at all, so a script that finds text frames overlapping by any amount would work in this case and also when one frame is larger and hiding a smaller frame. We wouldn’t want the script to make changes, just show us the problem frames.
So the script would find the first overlapping text frame in the file and we would fix it manually, then we would keep running the script until no overlapping text frames are found.
Or the script could give a list of pages with overlapping text frames.
In his post on this thread David Blatner fixed up a script that finds unlocked overlapping text frames except those that are the same size and Y coordinate (so not if either or both of the frames is locked to the master page and not if their size and position match exactly).
app.activeDocument.viewPreferences.rulerOrigin=RulerOrigin.SPREAD_ORIGIN;
//If you are going to work with pages, not spreads, change the line above to PAGE_ORIGIN;
for (a = 0; a < app.activeDocument.spreads.length; a ++) {
var pg = app.activeDocument.spreads [a];
for (b = 0 ; b < pg.textFrames.length; b ++) {
var r1 = pg.textFrames [b];
for (c = 0 ; c < pg.textFrames.length; c ++) {
var r2 = pg.textFrames [c];
var gb1 = r1.geometricBounds;
var gb2 = r2.geometricBounds;
if ((r1 != r2) &&
(gb1 [0] > gb2 [0] && gb1 [0] < gb2 [2] && gb1 [1] > gb2 [1] && gb1 [1] < gb2 [3]) ||
(gb1 [2] > gb2 [0] && gb1 [2] < gb2 [2] && gb1 [1] > gb2 [1] && gb1 [1] < gb2 [3]) ||
(gb1 [0] > gb2 [0] && gb1 [0] < gb2 [2] && gb1 [3] > gb2 [1] && gb1 [3] < gb2 [3]) ||
(gb1 [2] > gb2 [0] && gb1 [2] < gb2 [2] && gb1 [3] > gb2 [1] && gb1 [3] < gb2 [3])) {
r1.select ();
var cnf = confirm ("Text frames overlap. Continue searching?", true, "Overlapping text frames");
if (!cnf)
exit ();
}
}
}
}
Here’s the source of the original script:
https://stackoverflow.com/questions/33231516/indesign-javascript-to-find-overlapping-textframes
I know nothing about scripting and have no idea of how big of an ask this is, so no hard feelings if it’s more than you want to get into!