Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: Line count Help

$
0
0

Hi Jump_Over,

 

Thank you for your immediate response....

 

With the help of my senior I got the below line, it works great but I struggle in single line..

 

myText.insertionPoints[0].contents = "hi";   //I need line count 5, 10 ++++

 

 

 

var myDoc = app.activeDocument; 
var myLib = app.libraries[0]; 
var myArray = new Array; 
var myLines = app.activeDocument.stories.everyItem().lines.everyItem().getElements(); //~ var myLines = app.selection[0].parentStory.lines;  
n = 4;for(i=4; i<myLines.length; i++){     if(myLines[i].appliedParagraphStyle.name == "H1" || myLines[i].appliedParagraphStyle.name == "Equation 1" || myLines[i].appliedParagraphStyle.name == "Equation 2" || myLines[i].appliedParagraphStyle.name == "Equation 3")    {        n=n+0;          }     else     {        n=n+1;                  if (n%5==0)          {                             var myLineCount = myLines[i];                 alert("myLineCount: " + myLineCount)                           myText = myLib.assets.item("LN").placeAsset(myLines[i].insertionPoints[-2])[0];                                                    myText.appliedObjectStyle = app.activeDocument.objectStyles.item("LN_OBJ_STY");//~                                //~                          myText.insertionPoints[0].contents = "hi";             myText.insertionPoints[0].contents = Number(myLineCount);         //PLEASE HELP HERE            }      }}

 

 

Thanks

Beginner_X


Viewing all articles
Browse latest Browse all 37788

Trending Articles



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