1 Reply Latest reply on Dec 13, 2012 6:37 AM by Jump_Over

    Help!!!; apply conditional text

    shilpa25 Level 1

      hi forum,

       

      i have the script and edited to create and apply conditional text to which I have substituted in Find what;;

       

      but i presume, im doing mistaken in using properties for applying conditional text..

       

      could any body help on this..

       

       

      myCondition = app.activeDocument.conditions.add ({name:"Condition 1",

      indicatorMethod:ConditionIndicatorMethod.USE_HIGHLIGHT, indicatorColor:UIColors.YELLOW});

       

       

      app.findGrepPreferences = NothingEnum.nothing;

      app.changeGrepPreferences = NothingEnum.nothing;

       

      app.findGrepPreferences.findWhat = "(?i)(your|you|our)";

      app.changeGrepPreferences.applyConditons = "Condition 1";

      app.changeGrep();

       

      thanks

      shil....

        • 1. Re: Help!!!; apply conditional text
          Jump_Over Level 5

          Hi,

           

          In general watch type errors and syntax;

           

          working version:

          myCondition = app.activeDocument.conditions.item("Condition 1");

          if (!myCondition.isValid)

          {

          myCondition = app.activeDocument.conditions.add ({name:"Condition 1",

          indicatorMethod:ConditionIndicatorMethod.USE_HIGHLIGHT, indicatorColor:UIColors.YELLOW});

          }

          app.findGrepPreferences = NothingEnum.nothing;

          app.changeGrepPreferences = NothingEnum.nothing;

          app.findGrepPreferences.findWhat = "(?i)(your|you|our)";

          app.changeGrepPreferences.appliedConditions = ["Condition 1"];     // "appliedConditions" & array as a value;

          app.changeGrep();

           

           

           

          enjoy