3 Replies Latest reply on Jan 25, 2012 3:09 AM by கற்பனை (Imagine)

    [JS] Only.All.MS.Word.Para.Style Redefine Style

    snegig Level 1

      Hi all,

       

      Is that possible in my InDesign CS4 file all MS Word Para Style (like Floppy Icon) Redefine all Style on time.

       

      If you have any script please help me. My question is only Redefine all Para Style.

       

      Screen shot 2012-01-25 at 2.30.48 PM.png

       

      Thank you so much add.

       

      Regard

      snegig

        • 1. Re: [JS] Only.All.MS.Word.Para.Style Redefine Style
          கற்பனை (Imagine) Level 3

          It's written by Kasyan.

           

          var myDoc = app.activeDocument;

          removeFloppySymbols();

           

          function removeFloppySymbols(){

              for(var myCounter = myDoc.paragraphStyles.length - 1; myCounter > 0; myCounter--){

                  if (myDoc.paragraphStyles[myCounter].imported == true) {

                      var myParProperties = myDoc.paragraphStyles[myCounter].properties;

                      myDoc.paragraphStyles[myCounter].remove();

                      var myNewParStyle = myDoc.paragraphStyles.add();

                      myNewParStyle.properties = myParProperties;

                  }

              }

           

              for(var myCounter = myDoc.characterStyles.length - 1; myCounter > 0; myCounter--){

                  if (myDoc.characterStyles[myCounter].imported == true) {

                      var myCharProperties = myDoc.characterStyles[myCounter].properties;

                      myDoc.characterStyles[myCounter].remove();

                      var myNewCharStyle = myDoc.characterStyles.add();

                      myNewCharStyle.properties = myCharProperties;

                  }

              }

          }

          1 person found this helpful
          • 2. Re: [JS] Only.All.MS.Word.Para.Style Redefine Style
            snegig Level 1

            Hi Imagine,

             

            Thank you sooo much.

             

            Actually script do all floppy icon para style convert to (No Styles).

             

             

            My Problem is that all floppy icon para style only just Redefine Style (Not any style apply) which para style apply text (if i can any change para style) just updata/Redefine Style all floppy icon para style.

             

            Screen shot 2012-01-25 at 3.25.30 PM.png

             

            Regard

            snegig

            • 3. Re: [JS] Only.All.MS.Word.Para.Style Redefine Style
              கற்பனை (Imagine) Level 3

              I feel there is no properties or methods for redefine the style/text.  you have to do this by using menu action invoke(). 

               

              Waiting for some one suggestion for this......