Highlighted

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

Community Beginner ,
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.

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

TOPICS
Scripting

Views

61

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

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

Community Beginner ,
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.

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

TOPICS
Scripting

Views

62

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
Oct 14, 2020 0
Engaged ,
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
Reply
Loading...
Oct 14, 2020 2
Community Beginner ,
Oct 15, 2020

Copy link to clipboard

Copied

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
Reply
Loading...
Oct 15, 2020 0