Length of Rectangles on a page in InDesign CS5 js

Hi, I need to have amount of rectangles on specific layer on specific page, and it doesn't work together:
myBackRectangles = myDoc.pages[1].rectangles.length(myDoc.layers.item ("Layer 1"));
It gives me length of the rectangles on all layers, but I need specific layer and that doesn't work.
Thank you for your help.
Yulia

I can spot one possible cause of bad behavior: the list myBackRectangles should be processed from last to first. If you remove a page containing one of these rectangles, the order will get messed up
So I thought this would do the trick
for (var a =myBackRectangles.length-1; a>=0; a--)
.. but .. it does not.
Some further head-scratching later I changed the alert to this
alert (myBackRectangles[a].parent.index+"; page "+myBackRectangles[a].parent.name);
where the 'name' displays the actual page number as seen in InDesign. Confusion! For some reason the page index of all pages is '0'!
I think this has to do with spreads. Internally, each page is 'on a spread' (even when it's only one single page), and therefore it's the first page on that spread (with index 0). The spread itself has another index, and that leads to yet another problem! In a facing page document, the spread index 1 contains pages 2 and 3, spread index 2 contains pages 4 and 5, and so on.
So you cannot use 'index' to check for a specific page in a document with facing pages. With no facing pages, you can use parentPage.parent.index -- which gives you the index of its spread.
If you have a facing pages document ... I don't know how to do this! <- Scratch This!
Hip hip hooray! I thought I had seen it somewhere before.
Don't use 'index' for a page because that doesn't work. Use documentOffset instead! ("The sequential number of the page within the document.", says the Help.)
I cannot test for CS5, but this ought to work slightly better:
myBackRectangles = myDoc.layers.item ("Layer 1").rectangles;
    for (var a = myBackRectangles.length-1; a>=0; a--){
          alert (myBackRectangles[a].parentPage.documentOffset);
        if (myBackRectangles[a].parentPage.documentOffset == 1){
            var myArtBack = myBackRectangles[a].graphics[0];
            if (myArtBack.isValid == false){
                myDoc.pages[1].remove();

Similar Messages

  • How do i link text boxes between pages in indesign cs5

    How do i linbk text boxes between pages in indesign cs5 please

    It is indeed may be someone has moved the discussions,
    Regarding your issue, Check this link:- http://helpx.adobe.com/indesign/using/threading-text.html
    If you could explain what exactly you are trying to do we may help better.

  • Aligning lines between pages in InDesign CS5

    Hi all,
    After many  fruitless hours of Googling, I'm really, really hoping to find some help  here with a small InDesign CS5 issue I'm having. I'll try and keep this  brief.
    I'm currently designing a book in InDesign CS5  that has chapters that run one after the other. Whereas in most books a  new chapter will start on a new page, here they flow together. For each  chapter heading, I'm using a font called Orial, size 18. For the main  text, I'm using Adobe Garamond Pro, size 12. When I have two solid pages  of 12 point Adobe Garamond Pro, all is well. The alignment of lines on  both pages are level with one another. That's just what I want.
    However,  if I have a double page spread and one of the pages has an 18pt Orial  title on it (within all the 12pt Adobe Garamond Pro), this throws things  out of whack, as you can see in the image below:
    As you can see, the lines on page 79 are not level with those on page 78. Is there any way around this?
    Many, many thanks for any help you can offer. I'm rather tearing my hair out here!

    Hm, I'm afraid I'm still encountering problems here. I'll talk through what I've done so far using Josh's excellent guide:
    (I should note at the start that my text frames are all linked to one another, and I am using paragraph styles).
    Firstly, I checked 'Grids in Back' was switched off (thanks ghf232):
    Secondly, I turned on the following:
    View -> Screen Mode -> Normal
    View -> Extras -> Show Frame Edges
    View -> Grids -> Show Baseline Grid
    My document now looked like this:
    Then I highlighted all text with Ctrl+A:
    And next I hit the 'Align to baseline grid' button:
    This resulted in the following:
    Next, I went to Preferences -> Grids and changed 'Increment Every' option to 1.5:
    Alas, the lines remained uneven:
    I'm sure I'm missing something really obvious. If anybody couldhelp, I'd be hugely grateful. Thanks again all.

  • Data Merge Feature in Master page in InDesign CS5

    I really need some help, because I'm running out of time...
    I'm trying to create a merged document by using the Data Merge Feature in InDesign CS5. Normally it works fine, but right now I'm trying to create one with a .csv file imported in de master page so I can update it later on. That should work, fine but after 16 hours I still dont have a merged document. According to InDesign we aren't even at 25%! It only 142 records spread out over 9 pages. What do I do wrong? Can anybody provide me with an answer?

    Dutch Lauwie wrote:
    Normally it works fine, but right now I'm trying to create one with a .csv file…
    Dutch, does that mean that you normally use a different kind of file as a data source other than .csv? If so, which? I tried with both .csv and .txt (tab delimited text), and both worked fine for me on a simple test. Both allowd me to update the ID file after I had updated the data source.
    Dutch Lauwie wrote:
     …but after 16 hours I still dont have a merged document. According to InDesign we aren't even at 25%! It only 142 records…
    How long does something like this usually take for you? Is this a very complicated document when compared to the documents you usually do? You may have some document corruption, so trying the same data file on a new document might be worth a try. You might also want to try trashing your InDesign preferences also.

  • How to center web page made in indesign cs5

    Hi everyone,
    I'm new to this forum and I hope I'll get help, because I need it
    I've made a web page in indesign cs5, exported in SWF and generated HTML.
    My swf file looks good, but my html file is not centered, web page is positioned
    in upper left corner, and I want it to be in the center.
    How can I put it there?
    Thnx very much!
    Hresta

    I know ID is not the best option for a website, but I need it that way.
    I know html/css, but my generated html file contains javascript which
    I'm not familiar with :/
    There's no div so I don't know where to put my auto margins?
    Simply on top of the html file?
    Thnx anyway!!

  • Interactive pdf using Indesign CS5.5 problem with layering

    Hi all
    I have designed an interactive pdf - not for the web. I have a problem layering out a page. On the page there are 6 buttons. Each button when pressed will bring forward a box containing content/information. When I designed the page using indesign cs5.5 I made sure the largest box of information was at the top of the layer. I thought this would be the cleanest way to present the page. By having the largest content box (each of the six content boxes are different sizes) at the top it would cover the other boxes. When I exported the file out the smallest box was at the top, then the secondest etc. It looks pretty messy.
    Is there a way to ensure that the lagest content box is at the top when it exported to pdf????
    Regards

    Have patience!
    Have you tried putting that largest box on it's own layer at the top?  I don't know much about buttons etc though, if you wait someone will come on here that does.  A lot of contributors are in different time zones though.....

  • How Do You Insert a Video into InDesign CS5.5

    What application do you use for making the video?
    What are the steps after you make the video to place the video into a web page in InDesign CS5.5?

    InDesign cannot place a video into a web page. You might do that in Adobe Dreamweaver, Adobe's premiere program for handling HTML, CSS and JavaScript.
    InDesign CAN place a video into an interactive PDF file or a SWF (Flash Player) file.
    You can create video in many applications including Adobe Premiere Pro, Adobe Photoshop, Final Cut Pro, iMovie and many more applications.

  • Export selected items on each page in InDesign to JPEG

    Hi All,
    I have InDesign CS5.5. I have a document with more than 50 pages and each page has unique image and the description for image.
    I need to export each page as JPEG. but i don't want to export full page. i need only the items on each page. So i go to each page and select all the items and export. while exporting i use the same name of the image used in each page.
    I tried writing a script but it exports only the active page. i do not know how to navigate to the next page and export.
    is some one can help.
    below is my script.
    var myDoc = app.activeDocument;
    var myNumPages = myDoc.pages.length;  //get the number of pages
    var myFilePath = myDoc.filePath; //get the file path
    var myRectangle = app.activeWindow.activePage.allGraphics; //get the graphics of the active page
    var myPageName = app.activeWindow.activePage.name; //get the page name.
               if(myRectangle.length >1)
                        alert("the page has more than one image. Delete the other image to export");
                        exit();
    var myImageName = myRectangle[0].itemLink.name; //get the name of the image
    app.select(NothingEnum.NOTHING);
    for(var i=0; i<myNumPages; i++)
              app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.high;
              app.jpegExportPreferences.exportResolution = 300;
              app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.exportRange;
              app.jpegExportPreferences.pageString = myPageName;
              mySelectedItems();
    function mySelectedItems()
              var myObj = new Array;
              myObj = app.activeWindow.activePage.pageItems; 
              try
                                  app.activeWindow.activePage.groups.add(myObj);
                                  catch(e)
              app.select(app.activeWindow.activePage.allPageItems);
              app.selection[0].exportFile(ExportFormat.JPG, File(myFilePath+"/"+myImageName+".JPEG"), false);

    export all image of each page try like this
    var myDoc = app.activeDocument;
    var myFolder = myDoc.filePath;
    var myImage = myDoc.allGraphics;
    for (var i=0; myImage.length>i; i++){
        app.select(myImage[i]);
        var MyImageNmae  = myImage[i].itemLink.name;
        app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.high;
        app.jpegExportPreferences.exportResolution = 300;
           app.selection[0].exportFile(ExportFormat.JPG, File(myFolder+"/"+MyImageNmae+".JPEG"), false);
        alert(myImage[i].itemLink.name)

  • How to alphabetical order pages at indesign cs4?

    I have a text box at the beginning of each page and I want to alphabetical order pages based on that text box. Do you know how to do that?

    This will do it.
    But see also http://forums.adobe.com/thread/1082984?tstart=0 for a better workflow.
    For some reason the OP over there didn't get back to say thanks and mark the answer as correct .
    Trevor
    // Script to sort Pages according to alphabetical order of their top TextFrames contents
    // by Trevor (www.creative-scripts.com [coming soon]) custom and readymade scripts for InDesign
    // http://forums.adobe.com/thread/1405293?tstart=0
    // see also http://forums.adobe.com/thread/1082984?tstart=0 for a better workflow
    app.doScript("aToZPageSort()", ScriptLanguage.javascript, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Sort Pages By top text contents");
    function aToZPageSort () {
        var doc =  app.documents[0],
              myPageIndex = [],
              l = doc.pages.length,
              topFrameIndex = z= 0, pageFramesTops, i, topFrameHeight, topFrame;
        while (l--) {
            pageFramesTops = doc.pages[l].textFrames.everyItem().getElements().slice(0);
            n = i = pageFramesTops && pageFramesTops.length;
            if (!i) continue;
            while (n--) pageFramesTops[n] = pageFramesTops[n].geometricBounds[0]; // for some reason when one trys to get the geometricBounds[0] from teh everyItems without the elements it return y1, x1 and not just y1 ?-)
            topFrameHeight = pageFramesTops[0];
            topFrame = doc.pages[l].textFrames[0];
            for (var n = 0; n< i ; n ++) {
                if (pageFramesTops[n] < topFrameHeight) {
                    topFrameHeight = pageFramesTops[n];
                    topFrame = doc.pages[l].textFrames[n];
            myPageIndex [z++] = {page: topFrame.parentPage, contents: topFrame.contents.toLowerCase()}
        myPageIndex.sort (function (a,b) {return (a.contents.toLowerCase() > b.contents.toLowerCase())});
        l = myPageIndex.length;
        while (l--) myPageIndex[l].page.move (LocationOptions.AT_BEGINNING);

  • InDesign CS5 only prints one page at a time.

    InDesign CS5 only prints one page at a time. No multiple copies. Each page in a document has to be printed one at a time. I didn't have this problem with any version before this. No matter what I do, change settings, etc. I still have the same outcome. How do I work around this problem so I can print a 5 copies of a 3 page document without having to do each copy of each page one at a time.

    Sounds like a printer driver issue. Can you export to PDF and print that correctly?

  • How do I place text from Pages in InDesign

    How do I place text from Pages in InDesign?

    You will need to export the text from Indesign as either .rtf or .doc files and import those.
    You can also cut and paste but I assume you have already tried these options and are not happy with the result, but haven't said why.
    Peter

  • Indesign CS5 crashing public.dll when copying pages from one document to another

    Hello,
    I have several Lenovo W520 (Core i7-2720, 8GB ram, Quadro 1000M) and a couple Dell M6500 (Core i7, 4GB ram, Quadro FX 2800M) all running Windows 7 Pro x64, the latest video drivers and Adobe CS5, including Indesign 7.0.4.  We have several different Indesign docs that for the purpose of interactive Table of Contents, are copying pages from one to another to end up with one master document.  On the majority of the documents, copying as few as one page to another doc crashes Indesign with the windows system error below. 
    Faulting application name: InDesign.exe, version: 7.0.4.553, time stamp: 0x4d890440
    Faulting module name: Public.dll, version: 7.0.4.553, time stamp: 0x4d8903ca
    Exception code: 0xc0000005
    Fault offset: 0x00038727
    Faulting process id: 0x18c0
    Faulting application start time: 0x01ce1f68465d45de
    Faulting application path: C:\Program Files (x86)\Adobe\Adobe InDesign CS5\InDesign.exe
    Faulting module path: C:\Program Files (x86)\Adobe\Adobe InDesign CS5\Public.dll
    Report Id: fa196aee-8b5b-11e2-9afa-a088b43f1cec
    We have tried working with the documents on different machines (both specs outlined above), and copying different pages from one doc to another in varying quantities.  The documents do not have any link errors or other references that need to be corrected. 
    Any suggestions or other things to look at?
    Thanks.

    HI. Same problem Here. i will now trying to reinstall the software. hopefully it will help me.
    What could be the cause of this error? its not in english sorry for that.
    Název protokolu:Application
    Zdroj:         Application Error
    Datum:         22.4.2013 14:09:32
    ID události:   1000
    Kategorie úlohy:(100)
    Úroveň:        Chyba
    Klíčová slova: Klasické nastavení
    Uživatel:      Není k dispozici
    Počítač:       NB-CZ-1209.cz.corp.mann-hummel.com
    Popis:
    Název chybující aplikace: InDesign.exe, verze: 7.5.3.333, časové razítko: 0x4f6b9e72
    Název chybujícího modulu: Public.dll, verze: 7.5.3.333, časové razítko: 0x4f6b9c77
    Kód výjimky: 0xc0000005
    Posun chyby: 0x000df832
    ID chybujícího procesu: 0xad4
    Čas spuštění chybující aplikace: 0x01ce3f522c7f2f21
    Cesta k chybující aplikaci: C:\Program Files\Adobe\Adobe InDesign CS5.5\InDesign.exe
    Cesta k chybujícímu modulu: C:\Program Files\Adobe\Adobe InDesign CS5.5\Public.dll
    ID zprávy: 7d476cca-ab45-11e2-b201-009c02185dea
    Kód XML události:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Application Error" />
        <EventID Qualifiers="0">1000</EventID>
        <Level>2</Level>
        <Task>100</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2013-04-22T12:09:32.000000000Z" />
        <EventRecordID>12469</EventRecordID>
        <Channel>Application</Channel>
        <Computer>NB-CZ-1209.cz.corp.mann-hummel.com</Computer>
        <Security />
      </System>
      <EventData>
        <Data>InDesign.exe</Data>
        <Data>7.5.3.333</Data>
        <Data>4f6b9e72</Data>
        <Data>Public.dll</Data>
        <Data>7.5.3.333</Data>
        <Data>4f6b9c77</Data>
        <Data>c0000005</Data>
        <Data>000df832</Data>
        <Data>ad4</Data>
        <Data>01ce3f522c7f2f21</Data>
        <Data>C:\Program Files\Adobe\Adobe InDesign CS5.5\InDesign.exe</Data>
        <Data>C:\Program Files\Adobe\Adobe InDesign CS5.5\Public.dll</Data>
        <Data>7d476cca-ab45-11e2-b201-009c02185dea</Data>
      </EventData>
    </Event>

  • Text flow to additional pages at end of document, how to set up in InDesign CS5

    I've added additional pages to a document in InDesign CS5 -- but how do I set up my document so when text is supposed to get pushed to the additional pages the text flows from page to page on these extra added pages? Right now I've added additional pages to the end of my document and when the text from the original document gets pushed past the end it disappears and not continued on the additional pages.
    Thanks,
    Jeff

    P Spier wrote:
    Yeah, container may not be the best word to describe a book, which is why I put it in quotes, and I certainly didn't mean to imply that you can no longer open and edit the files outside the book. Doing that, however, means next time you open the book ID will complain and ask you to update things. No big deal, but if you open through the book panel it will save the changes through the book and that won't happen. No difference to the inidividual files.
    Historically - as in *roff and other UNIX-based processing programs like xroff, nroff, etc - books that were published from multiple individual component files, were produced by the use of a "makefile." You'd need to create the makefile by typing the names of the component files in the book order, along withtheir specifications, such as starting page side, starting page number, etc. You'd save the makefile with a name to preserve all this information, then you'd run the "make" command-line command in which you'd name the makefile, and include arguments such as which printer, how many copies, even a job priority, to avoid unnecessarily hogging the network bandwidth and free the printer for higher-priority jobs. As GUI capable hardware and software progressed, command-line makefiles became GUI book files - still, basically lists of component files and processing instructions.
    One important value of book files that don't contain component files is that different book files can control the processing of the same component files in different ways, as well as produce books that use some of the same files and some different files - for different audiences, different product sets, etc. Yes, opening a book file may warn that component files have changed - a good warning to the user to pay attention - and they offer a way to update the collection of component files so that the book file produces the desired result. Here's where some folks may be surprised when they find that sometimes a print or export dialog box, either retains or forgets the settings used for the previous run; the result may be printing multiple copies instead of one, printing to a different printer than expected, or exporting a PDF that's not suitable for the desired printer.
    The short story is that while book processing lists that are separate from the component files offer flexibility and reusability, but they also require that the user pays attention.
    Did I commingle Autoflow and Smart Text Reflow in some way? I didn't think so.
    Not at all. I'm just extra-sensitive to my own experiences with not having taking pains to keep clear on the differences between these similar-sounding terms.
    My point was that HOW your text was put into the file to begin with, coupled with how your settings for STR are configured, is going to control whether subsequent editing triggers reflow. It's possible to have STR enabled and not have it work because you've limited it to master text frames and you haven't actually used any. An understanding of how autoflow works when placing text is important to being able to troubleshoot why STR is not behaving as expected (not to mention why text frames may not be adjusting if you edit the master page).
    One reason for the confusions that come from working with Smart Text Reflow is that there's no indication in the UI, that STR is enabled, and when it's enabled, there's no indication in the UI of which STR settings are in effect, except by seeing the behavior. Are pages added at the end or story, section, or document? You may see them added in the Pages panel, if it's open, on screen, and if the appropriate portion of the document is in view; you may see them added on screen if the appropriate portion of the document is on screen - the end of story, section, or document.
    In InDesign's Help, Smart Text Reflow is covered in only a few paragraphs. As you noted, there's much more to it.
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • InDesign CS5.5 crashes while applying Template to a page

    Hi,
    We installed Adobe InDesign CS5.5. on 10 Windows XP SP3 32-bit workstations with 2 GB RAM. On every computer, when a user tries to apply a template to a page in a .indd document, InDesign immediately shuts down without displaying any error messages. Using the Sysinternals Tools and Dr.Watson, I think that the faulty plugin might be this one: C:\Program Files\Adobe\Adobe InDesign CS5.5\Plug-Ins\Layout\PAGES PANEL.APLN.
    Here's a part of the drwtsn32.log file (the full log can be made available upon request):
    Une exception d'application s'est produite :
            App : C:\Program Files\Adobe\Adobe InDesign CS5.5\InDesign.exe (pid=2844)
            Lorsque : 2012-08-13 @ 14:32:37.017
            Numéro d'exception : c0000005 (violation d'accès)
    *----> Liste des tâches <----*
       0 System Process
       4 Error 0xD0000022
    452 Error 0xD0000022
    508 Error 0xD0000022
    532 Error 0xD0000022
    576 Error 0xD0000022
    588 Error 0xD0000022
    764 Error 0xD0000022
    *----> Suivi arrière de la pile <----*
    WARNING: Stack unwind information not available. Following frames may be wrong.
    *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Program Files\Adobe\Adobe InDesign CS5.5\Required\LAYOUT.RPLN -
    ChildEBP RetAddr  Args to Child             
    06606b88 0625bf00 00020002 0408010b 0a8b1984 CJKGRID+0x20b55
    0aa2915c 0aa1f130 0aa21a50 0aa1cb90 0aa1ba60 0x625bf00
    0aa1d060 8108244c 000132f9 8b157500 c985044e LAYOUT+0xf130
    8bf18b56 00000000 00000000 00000000 00000000 0x8108244c
    Has anybody ever experienced this issue ? Are there known workarounds ?
    Let me know if you need additionnal information.
    Thank you in advance !
    LR

    Hi,
    I am not sure if this is a "Master Page since we use a French version (the functionnality is  named "Gabarit" in French), so here is a printscreen which shows what our users try to do:
    Immediately after the drop is completed, InDesign shuts down without further notice as described before.
    I fully patched one machine to 7.5.3, rebooted it and it still does not work.
    I know 2 GB is a little bit short, but since this is currently a corporate standard in my customer's organization, I will need to be sure that this is the direct and only cause before any upgrade request can be made.
    Thank you for your help.

  • , Page Numbering/TOC in InDesign CS5

    Hi, I am using InDesign CS5 and need some help showing the page numbers for a section that will be added after printing.
    I have almost completed a low volume 400+ page book (60 copies) and need some special numbering.
    I am using 8 & 16pp signatures in this book. The first section is: Front Matter, the second section is for Front Text, the Center Section is a color photo album with 40pp (2-16pp & 1-8pp signatures), and the fourth section is Back Text.
    The Center Section will be printed on a color printer and hand inserted at the binders. I have no problem with the numbering of all the sections, but I would like to have the center section to be included in the Table of Contents of the book. I could update the TOC manually but as I move things around that would be a lot of work and I might have errors later. I hope that I made this question clear enough. Any help would be greatly appreciated.

    I would add the pages for the color section and any headings you want to include in the TOC, and simply not include it in the PDF you send to the the monochrome printer, and include only that section in a PDF for the color printer.

Maybe you are looking for