Skip to main content
Lara_seven
Known Participant
November 22, 2018
Answered

White fill text overprint need to be select

  • November 22, 2018
  • 1 reply
  • 1935 views

I need your help. I am new to write the javascript.  I need to select the white text with overprint enabled (White means: C=0, M=0, Y=0, K=0).

I am writing the script but I don't it is not working properly. kindly highlight my error or advice me. 

Reference script below: 

#target illustrator-21

function fillColorOp(){

    var doc = app.activeDocument;

 

    doc.selection = null;

  

     for(var i=0; i < doc.textFrames.length; i++)

  

     var thisTf = doc.textFrames;

  

     {

          for ( var j = 0; j < thisTf.textRanges.length; j++ ) 

       

          var thisTr = thisTf.textRanges;

          {

              if(thisTr.characterAttributes.fillColor &&

           

              (Math.round(thisTr.characterAttributes.fillColor.cyan) == 0) &&

           

              (Math.round(thisTr.characterAttributes.fillColor.magenta) == 0) &&

           

              (Math.round(thisTr.characterAttributes.fillColor.yellow) == 0) &&

           

              (Math.round(thisTr.characterAttributes.fillColor.black) == 0) && (thisTr.characterAttributes.fillOverprint))

           

              {

               

                  thisTr.selected = true;

                     

                  };

           

              };

       

          };

   

      };

  fillColorOp();

Thanks in advance

Kalaimani.S

This topic has been closed for replies.
Correct answer renél80416020

Salut Kalaimani

Strictement ce que​ tu as demandé,

// JavaScript Document

#target illustrator

function fillColorOp(){

  var thisTf, color;

  var doc = app.activeDocument;

      doc.selection = null;

        for (var i = 0; i < doc.textFrames.length; i++) {

          thisTf = doc.textFrames;

          color = thisTf.textRange.characterAttributes.fillColor;

            if (thisTf.textRange.characterAttributes.overprintFill) {

              if(!color.cyan && !color.magenta && !color.yellow && !color.black) {

                  thisTf.selected = true;

              }

            }

        }

}

  fillColorOp();

de elleere

1 reply

renél80416020
renél80416020Correct answer
Inspiring
November 23, 2018

Salut Kalaimani

Strictement ce que​ tu as demandé,

// JavaScript Document

#target illustrator

function fillColorOp(){

  var thisTf, color;

  var doc = app.activeDocument;

      doc.selection = null;

        for (var i = 0; i < doc.textFrames.length; i++) {

          thisTf = doc.textFrames;

          color = thisTf.textRange.characterAttributes.fillColor;

            if (thisTf.textRange.characterAttributes.overprintFill) {

              if(!color.cyan && !color.magenta && !color.yellow && !color.black) {

                  thisTf.selected = true;

              }

            }

        }

}

  fillColorOp();

de elleere

Lara_seven
Known Participant
November 26, 2018

It is working good on fill color text but is not working with the appearance...Thanks a lot.

Lara_seven
Known Participant
November 26, 2018

Hi... kalaimanis71535121​, I asked you here... Preflight Pre-Press

What did you mean by appearance?


We are filled are stroked it appears on appearance palate. Snapshot for your reference.

(Note: hight lighted color is white).

Test file has attached: https://drive.google.com/open?id=1LFJEkjDTFRtI7C8LdYvZr58jpOa4Zgxm

Thanks and regards.

Kalaimani.s