2 Replies Latest reply on Jan 19, 2015 10:13 AM by Trevorׅ

    Conditional Text  green Color

    Level 1

      How to highlight green color via conditional text for particular character style. 

       

      I have copied my code for your reference. My code apply random colors, but i need to apply green color

       

       

      var myf=Folder.selectDialog("Choose folder for Application File");

      if (myf != null)

      {

          var indFiles=myf.getFiles("*.indd");

          for (noF=0;noF<indFiles.length;noF++)

          {

              cur_doc = app.open(File(indFiles[noF],false));

              var hlCond;

              //hlCond =curDoc.conditions.itemByName("Highlight");

              app.conditionalTextPreferences.showConditionIndicators = ConditionIndicatorMode.SHOW_AND_PRINT_INDICATORS;

              hlCond = app.activeDocument.conditions.add ({name:"Highlight"});

             hlCond.indicatorMethod = ConditionIndicatorMethod.USE_HIGHLIGHT;

              hlCond.visible = true;

              funFindChangeText(cur_doc, "Book Italic", hlCond)

              funFindChangeText(cur_doc, "Medium Italic", hlCond)

              cur_doc.close(SaveOptions.YES)

          }

      }

       

       

      function funFindChangeText(argWheretoSearch, argFindWildCard, argCond)

      {

        app.findTextPreferences=NothingEnum.nothing;

          app.changeTextPreferences=NothingEnum.nothing;

          app.findTextPreferences.fontStyle = argFindWildCard;

          app.changeTextPreferences.appliedConditions = [argCond];

          argWheretoSearch.changeText();

          //return foundItems;

      }