Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 97529

Re: Delete All Styles and Groups Script - Preserve All Formatting

$
0
0

I found another script that does delete paragraph, character and object styles that are NOT located in group folders and preserves the formatting. Is there code that can be added to remove styles that are contained IN group folders and preserve formatting?

Here is the script:

 

#target InDesign     

    myDoc = app.activeDocument;     

         

    var chs1 = myDoc.characterStyles.length;     

    for(var j=chs1-1; j>0; j--) //j++ replaced here by j--     

    {     

      myDoc.characterStyles[j].remove();     

    };     

 

 

 

 

  var pghs1 = myDoc.paragraphStyles.length;     

    for(var i=pghs1-1; i>0; i--) //j++ replaced here by j--     

  try  {     

      myDoc.paragraphStyles[i].remove();     

    }     

catch(e){} ; 

 

 

  var objs1 = myDoc.objectStyles.length;     

    for(var n=objs1-1; n>0; n--) //j++ replaced here by j--     

    {     

      myDoc.objectStyles[n].remove();     

    };     


Viewing all articles
Browse latest Browse all 97529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>