9 Replies Latest reply on Dec 8, 2014 3:26 AM by camilo umana

    I want to get all paragraphs of a document

    LearnIndesignScripting Level 1

      Hi ,


      I want to get all paragraphs of a document(where document has table and cell and it contains some para as well)


      Here is my script.


      var objDoc = app.activeDocument;

      var objDocName= objDoc.fullName.toString();


      var par=objDoc.stories.everyItem().paragraphs.everyItem().getElements();

      var paraLength=par.length;


                                    for (j = 0; j < par.length; j++)





                                          var text =    par[j].contents;

                                        var endIP = par[j].insertionPoints.firstItem();

                                          var endTF = endIP.parentTextFrames[0];                           

                                          var endCitationPage = endTF.parentPage;       

                                          var index=endCitationPage.index;

                                          var offset=endCitationPage.documentOffset;

      //~                                     $.writeln(text + "  Page : " + endCitationPage.name);

      //~                                     $.writeln(index);






      This script does not give me the text which is a part of  Cells.



      Is there a property where we can get all the para from doc like :



      var par=objDoc.paragraphs.everyItem().getElements();