3 Replies Latest reply on Oct 26, 2015 12:43 PM by Kasyan Servetsky

    InDesign script to alternate text color every other line in a text box

    Andrew-Hodgson

      I have a very long list of names that I need to alternate the CMYK color value every other line.

      I found this script on another adobe thread that changes the tint every 3rd line:

      var i, p; for (i=0; i<app.selection[0].paragraphs.length; i++) { p = app.selection[0].lines[i]; if (i%3 === 2) { p.fillTint = 50; } } 

      I tried changing the script to change the CMYK value doing this:

      var i, p; for (i=0; i<app.selection[0].paragraphs.length; i++) { p = app.selection[0].lines[i]; if (i%2 === 1) { p.colorValue=[0,100,100,0]; } } 

      But using "colorValue" is not supported. How can I change the script to make every other line in a text box change the color value?