11 Replies Latest reply on Sep 23, 2016 2:17 AM by Suzan.V

    Help about Paragraph and character styles scriptting

    Suzan.V Level 1

      Hello all,

       

      i'm working on a large project with many files, i have to change edit on all Paragraph styles with multiple processes

       

      for ex, change font for all Paragraph styles on all opened documents

       

                var docs = app.documents;  
                       
                for (var d = docs.length-1; d >= 0; d--) {  
                        var doc=docs[d]; 
                        
      var pstyles = doc.allParagraphStyles;  
      for (var a = 1; a < pstyles.length; a++) {    
                                if (pstyles[a].appliedFont.name=="Arial\tBold")    
                                     pstyles[a].appliedFont = "Arial\tBold Italic";    
                           }
                       }
      

       

      but i found some text inside frames with (locked position) so my find/change didn't apply on it

       

      so are there anyway to do this process to all locked position frame??

       

      or at least do un lock to all opened documents but i only can do this for active doc

       

      app.activeDocument.pageItems.everyItem().locked = false

       

       

       

      another thing, i tried to edit on all Character styles on files and i wrote code with my little scripting knowledge but it seems not working, any hint please???

       

                var docs = app.documents;  
                       
                for (var d = docs.length-1; d >= 0; d--) {  
                        var doc=docs[d]; 
                        
      var cstyles = doc.allCharacterStyles;  
      for (var a = 1; a < cstyles.length; a++) {    
                                if (cstyles[a].appliedFont.name=="Arial\tBold")    
                                     cstyles[a].appliedFont = "Arial\tBold Italic";  
                           }
      }
               }  
      

       

      Thanks in advance