2 Replies Latest reply on Mar 31, 2011 2:04 AM by paolbot

    Object don't support appliedparagraphStyle

    paolbot Level 1

      I use this notation on my script but I have this problem:

      in first case (appliedCharacterStyle) my script runs fine;

      in second case (appliedparagraphStyle) ID returns me an error:

       

      Javascript error 55

      Object don't support appliedparagraphStyle

       

      Note that the grep finder return me the good occorrence, is just in the app.changeGrepPreferences.appliedparagraphStyle the error.

       

      Someone can help me?

      Many thnX

       

      app.findGrepPreferences.findWhat = "<(.+?)>";

          var myFoundItems = app.activeDocument.findGrep();

          var myCounter = myFoundItems.length-1

          myTotal = myCounter+1;

          //alert("occorrenze" + myTotal);

          app.changeGrepPreferences.changeTo= "$1";

          app.changeGrepPreferences.appliedCharacterStyle= myDocument.characterStyles.item("text");

         myDocument.changeGrep();


      app.findGrepPreferences.findWhat = "£(.+?)£";

          var myFoundItems = app.activeDocument.findGrep();

          var myCounter = myFoundItems.length-1

          myTotal = myCounter+1;

          alert("occorrenze" + myTotal);

          app.changeGrepPreferences.changeTo= "$1~b";

          app.changeGrepPreferences.appliedparagraphStyle= myDocument.paragraphStyles.item("headR");

         myDocument.changeGrep();