Skip to main content
Thiago Ribeiro Nogueira
Participating Frequently
October 14, 2020
Answered

Script to tell me if I have more than one frame in the page

  • October 14, 2020
  • 1 reply
  • 333 views

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.

This topic has been closed for replies.
Correct answer Mike Bro

Hello,

Please see post below....

https://community.adobe.com/t5/indesign/comment-automatiser-la-recherche-du-nombrede-blocs-par-page-dans-un-grand-nombre-de-pages/td-p/11503172?page=1

 

 

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

1 reply

Mike BroCorrect answer
Legend
October 14, 2020

Hello,

Please see post below....

https://community.adobe.com/t5/indesign/comment-automatiser-la-recherche-du-nombrede-blocs-par-page-dans-un-grand-nombre-de-pages/td-p/11503172?page=1

 

 

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

Thiago Ribeiro Nogueira
Participating Frequently
October 15, 2020

Thank you!