Skip to main content
uniqued_tol
Inspiring
April 17, 2017
Question

Removing the unused character style also deletes the bullet

  • April 17, 2017
  • 1 reply
  • 963 views

I'm using this script (Kasyan Servetsky) in my documents but character styles in bullets are removed too.

Have any way to preserve in these cases?

var myDoc = app.activeDocument; 

var myCharStyles = myDoc.allCharacterStyles;

for (i = myCharStyles.length-1; i >= 1; i-- ) {

 

   removeUnusedCharStyle(myCharStyles); 

function removeUnusedCharStyle(myChStyle) { 

   app.findTextPreferences = NothingEnum.nothing; 

   app.changeTextPreferences = NothingEnum.nothing; 

   app.findTextPreferences.appliedCharacterStyle = myChStyle; 

   var myFoundStyles = myDoc.findText(); 

      if (myFoundStyles == 0 ) 

      { 

         myChStyle.remove(); 

      } 

   app.findTextPreferences = NothingEnum.nothing; 

   app.changeTextPreferences = NothingEnum.nothing; 

I need to preserve character style into paragraph style!

Thanks advice...

This topic has been closed for replies.

1 reply

uniqued_tol
Inspiring
April 23, 2017

Delete Unused Paragraph Styles  Here you can follow !

MANDELWERK17123829
Participant
October 1, 2019

Hello
The link takes me to the start page of Adobe Community... 😞
Johan