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

Community Beginner ,
Oct 14, 2020 Oct 14, 2020

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.

TOPICS
Scripting

Views

109

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Enthusiast , Oct 14, 2020 Oct 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"))...

Likes

Translate

Translate
Enthusiast ,
Oct 14, 2020 Oct 14, 2020

Copy link to clipboard

Copied

Hello,

Please see post below....

https://community.adobe.com/t5/indesign/comment-automatiser-la-recherche-du-nombrede-blocs-par-page-...

 

 

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 15, 2020 Oct 15, 2020

Copy link to clipboard

Copied

LATEST

Thank you!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines