Skip to main content
Participant
October 13, 2020
Answered

Comment automatiser la recherche du nombrede blocs par page dans un grand nombre de pages?

  • October 13, 2020
  • 1 reply
  • 320 views

Bonjour.
Il arrive que par mégarde, lorsque je colle du texte, il se retrouve collé non pas là où je le souhaite mais dans un bloc de texte créé automatiquement. En général je vois que rien n'est collé là où je le voulais, je vois le bloc créé et peux le supprimer ou effectuer cmd-Z. Mais sur un document fréquemment mis à jour de plus de 250 pages comportant toutes 5 blocs de texte, j'oublie des blocs et, à moins de faire cmd+A page par page, je ne vois pas les blocs superfétatoires.
Existe-il une commande ou un plug-in permettant de montrer sur un tableau, comportant toutes les pages, le nombre de blocs de texte de chaque page? Ou mieux de m'indiquer les pages comportant un nombre de blocs supérieur à 5?

This topic has been closed for replies.
Correct answer brian_p_dts

Here is a short .jsx script that would show you the pages with more than 5 text frames in the active document. For info on installing scripts, read this: https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php

 

 

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 > 5) {
        pageFinds.push(thePages[i].name);
    }
}
alert("Pages with more than 5 text frames:\n" + pageFinds.join("\n"));

 

Note: this will not count text frames in the pasteboard.

1 reply

brian_p_dts
Community Expert
brian_p_dtsCommunity ExpertCorrect answer
Community Expert
October 13, 2020

Here is a short .jsx script that would show you the pages with more than 5 text frames in the active document. For info on installing scripts, read this: https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php

 

 

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 > 5) {
        pageFinds.push(thePages[i].name);
    }
}
alert("Pages with more than 5 text frames:\n" + pageFinds.join("\n"));

 

Note: this will not count text frames in the pasteboard.