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

Line count Help

$
0
0

Hi All,

 

Please help to alert the 5th, 10th, 15th, 20th line contents.

 

Condition is, if the 5th, 10th, 15th, 20th line should H1, Equation1, Equation2, Equation3 then script alert the next line.

 

Please HELP.

 

Please refer screenshot

 

Screen Shot 2013-12-02 at 12.06.13 PM.png

 

Trying Script:

 

 

var myDoc = app.activeDocument; 
var myLib = app.libraries[0];  
var myLines = app.activeDocument.stories.everyItem().lines.everyItem().getElements(); //~ var myLines = app.selection[0].parentStory.lines;   for(i=4; i<myLines.length; i = i+5){   if(myLines[i].appliedParagraphStyle.name == "H1" || myLines[i].appliedParagraphStyle.name == "Equation1")    {         i = i+1;           }      if(myLines[i].appliedParagraphStyle.name == "H1" || myLines[i].appliedParagraphStyle.name == "Equation1")        {            i= i+1;            }       if(myLines[i].appliedParagraphStyle.name == "H1" || myLines[i].appliedParagraphStyle.name == "Equation1")        {            i= i+1;            }       if(myLines[i].appliedParagraphStyle.name == "H1"|| myLines[i].appliedParagraphStyle.name == "Equation1")        {            i= i+1;            }    var temp = myLines[i].contents;    alert(temp)       myText = myLib.assets.item("LN").placeAsset(myLines[i].insertionPoints[0])[0];       myText.appliedObjectStyle = app.activeDocument.objectStyles.item("LN_OBJ_STY");       myText.insertionPoints[0].contents = i;      }

 

Could anyone please help

 

Thanks in advance

Beginner_X


Viewing all articles
Browse latest Browse all 15932

Trending Articles



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