Copy link to clipboard
Copied
I'm looking for a solution (script) for Indesign that tell me if I have only one main text frame in the pages of my document and if is not true give me a alert that shows me the page number that have more than one.
Hello,
Please see post below....
var pageFinds = [];
var thePages = app.documents[0].pages.everyItem().getElements();
var tfs;
for (var i = 0; i < thePages.length; i++) {
tfs = thePages[i].textFrames;
if (tfs.length > 1) {
pageFinds.push(thePages[i].name);
}
}
alert("Pages with more than 1 text frames:\n" + pageFinds.join("\n"))
...
Copy link to clipboard
Copied
Hello,
Please see post below....
var pageFinds = [];
var thePages = app.documents[0].pages.everyItem().getElements();
var tfs;
for (var i = 0; i < thePages.length; i++) {
tfs = thePages[i].textFrames;
if (tfs.length > 1) {
pageFinds.push(thePages[i].name);
}
}
alert("Pages with more than 1 text frames:\n" + pageFinds.join("\n"));
I made a couple of minor changes to meet your requested needs.
Regards,
Mike
Copy link to clipboard
Copied
Thank you!