6 Replies Latest reply on May 23, 2010 9:42 PM by RidNath

    How to Map the styles in indesign

    RidNath

      I have updated certain styles in template now I need to updated those styles in source indd file.

       

      Do we have any way to map the styles or do we can replace the styles from one indd doc to another is there possible.

       

      Otherwise do we have any other simplest way in indesign.

       

      I have to replace more than 30 to 40 documents.

       

      Then it take so long time.

       

      Is there any script to make it soon.

        • 1. Re: How to Map the styles in indesign
          Mac_06 Level 2

          That is very handy, use this code

           

           

          var theDocument = app.activeDocument;
          
          //Choose Source file (from which you want to import styles).
          var sourceFile = File.openDialog ("choose file", false);
          
          //import paragraph styles
          var paraImport = ImportFormat.PARAGRAPH_STYLES_FORMAT;
          
          //This will import without overwrite existing styles.
          var clashPolicy = GlobalClashResolutionStrategy.DO_NOT_LOAD_THE_STYLE;
           
          theDocument.importStyles(paraImport, sourceFile, clashPolicy);
          

           

           

          Mac

          • 2. Re: How to Map the styles in indesign
            RidNath Level 1

            Thanks

             

            It works now I can add the new style from one doc to another without overwriting. But what I need is how to replace the sytle name from one doc to another.

             

            Acutally I have  10 indd files in that i need to change the style name according to the publishing standard but these indd doc already some guys did as they  wish that makes me a big probs.

             

            Kindly give a solution in this matter.

            • 3. Re: How to Map the styles in indesign
              Mac_06 Level 2

              Try to find out this in OMV which is with ESTK.

               

              //Change respective line to next line.

               

              var clashPolicy = GlobalClashResolutionStrategy.DO_NOT_LOAD_THE_STYLE;

               

               

              var clashPolicy = GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE;

               

               

              Mac

              • 4. Re: How to Map the styles in indesign
                RidNath Level 1

                The actual probs is I need to replace only the style naming not the style.

                 

                Example:

                 

                In indd file the style name is "Title" I need to replace this style name to Chapter Title.

                 

                Is this Possible in

                 

                scripting?

                • 5. Re: How to Map the styles in indesign
                  Shonkyin Level 3

                  REMO1980 wrote:

                   

                  The actual probs is I need to replace only the style naming not the style.

                   

                  Example:

                   

                  In indd file the style name is "Title" I need to replace this style name to Chapter Title.

                   

                  Is this Possible in

                   

                  scripting?

                   

                  Yes its possible ....

                   

                  Check below code

                   

                  //rename paragraph style
                  var myDoc = app.activeDocument;
                  if (myDoc.paragraphStyles.item("Title") != null)
                  {
                  myDoc.paragraphStyles.item("Title").name = "Chapter Title";
                  }
                  

                   

                  But if you importing template style and your template style naming is different then your document stye. I think you can also use delete old style and replace with your new style.

                   

                  //delete and replace paragraph style
                  if (myDoc.paragraphStyles.item("Title") != null && myDoc.paragraphStyles.item("Chapter Title") != null)
                  { 
                  myDoc.paragraphStyles.item("Title").remove("Chapter Title");
                  }
                  

                   

                   

                  Shonky

                  1 person found this helpful
                  • 6. Re: How to Map the styles in indesign
                    RidNath Level 1

                    Thanks. Really it works.