Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

I want to get all paragraphs of a document

$
0
0

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;

$.writeln(paraLength);

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

                              {

                               

                               

                                  $.writeln(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();


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>