• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Explorer ,
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

198

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

Advisor , 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"))
...

Votes

Translate

Translate
Advisor ,
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

Votes

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
Explorer ,
Oct 15, 2020 Oct 15, 2020

Copy link to clipboard

Copied

LATEST

Thank you!

Votes

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