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
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