7 Replies Latest reply on Jul 27, 2011 10:08 PM by Bhatt, Manish

    Help!!! Style name check

    Bhatt, Manish

      Hello

       

      Indesign  paragraph style and character style name should be lowercase.

       

      For Example:

      001_Head_Body_list

       

      it should change by:

      001_head_body_list

       

       

      Please support me and write a javascript and send as

        • 1. Re: Help!!! Style name check
          oblakoid Level 1

          if  (app.documents.length>0){
              for (var i=1; i<app.activeDocument.characterStyles.length;i++){
                  app.activeDocument.characterStyles[i].name=app.activeDocument.characterStyles[i].name.toL owerCase();
              }
              for (var j=2; j<app.activeDocument.paragraphStyles.length;j++){
                  app.activeDocument.paragraphStyles[j].name=app.activeDocument.paragraphStyles[j].name.toL owerCase();
             }
          }

           

           

           

          Simple script which should change names of  paragraph and character styles in active document to lower case.

          • 2. Re: Help!!! Style name check
            Bhatt, Manish Level 1

            Hi it not working there are error can you check again

             

            Error Number:25

            Error string: Expected:;

            Line: 3

             

            source: app.activeDocument.characterStyles[i].name=app.activeDocument.charact erStyles[i].name.toLowerCase();

            offending text: erStyles

             

            please check and correct js send me

            • 3. Re: Help!!! Style name check
              Mac_06 Level 2

              Could be eaisly figured out one unexpected space breaking your code:

               

              source: app.activeDocument.characterStyles[i].name=app.activeDocument.charact erStyles[i].name.toLowerCase();

               

              Replace with:

               

              app.activeDocument.characterStyles[i].name=app.activeDocument.characterStyles[i].name.toLowerCase();
              


              Mac

              • 4. Re: Help!!! Style name check
                Bhatt, Manish Level 1

                thanks a lot

                 

                can you again help me if my folder name and my indesign file name is mismatch then how we correct then. this type any JS

                 

                example folder name: 006-008_Co-ordination

                 

                and indesign name is : 006_008-Co-ordination

                 

                please send me

                • 5. Re: Help!!! Style name check
                  Mac_06 Level 2

                  simple stuff:

                   

                  var Doc = app.activeDocument;
                  var myDocName = Doc.name.split(".")[0];
                  var parentFolderName = String(Doc.filePath).split("/").pop()
                  if(myDocName==parentFolderName)
                  alert ("Yes, your file name and folder name are same")
                  else
                  alert ("No, your file name and folder name are different")
                  


                  Mac

                  • 6. Re: Help!!! Style name check
                    Bhatt, Manish Level 1

                    HI

                     

                    var Doc = app.activeDocument;
                    var myDocName = Doc.name.split(".")[0];
                    var parentFolderName = String(Doc.filePath).split("/").pop()
                    if(myDocName==parentFolderName)
                    alert ("Yes, your file name and folder name are same")
                    else
                    alert ("No, your file name and folder name are different")

                     

                    I can run the script on batch and generated a error log on text file which file name not match and folder name also not match

                     

                    can you help me?

                    • 7. Re: Help!!! Style name check
                      Bhatt, Manish Level 1

                      please you can also help me on this script

                       

                      if my file name is US_001-002_opener

                       

                      and my folder name is 001-002_opener

                       

                      i can only check a page number range and hyphen

                       

                      please suggest