Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Remove All Unused Styles...Jongware...?

$
0
0

Hello Jongware!

 

After a couple of changes for ID CC2014 as you'll note below (" -> ', and, Object Styles) to an old couple lines of your code, I got the following to work beautifully to delete all the unused Indesign styles in a document off a hot key. A real time saver!

 

//DeleteAllUnusedStyles

app.menus.item('Paragraph Style Panel Menu').menuItems.item('Select All Unused').associatedMenuAction.invoke();

app.menus.item('Paragraph Style Panel Menu').menuItems.item('Delete Styles…').associatedMenuAction.invoke();

app.menus.item('Character Style Panel Menu').menuItems.item('Select All Unused').associatedMenuAction.invoke();

app.menus.item('Character Style Panel Menu').menuItems.item('Delete Styles…').associatedMenuAction.invoke();

app.menus.item('Object Styles Panel Menu').menuItems.item('Select All Unused').associatedMenuAction.invoke();

app.menus.item('Object Styles Panel Menu').menuItems.item('Delete Styles…').associatedMenuAction.invoke();

 

The only thing stopping me from popping it into a loop to do a whole book at once (a trick I got from your excellent show-hide layers script) is that I don't know how to "Check The Box" in the ID UI that opens as it does each panel to make it "Apply To All". I'm sure it's quite simple but I've been through your handy dandy Script classes list, and ExtendScript, 'til I'm blue in the face and can't take it any more.

 

Can you offer me a hint where to look?

 

Best Regards,

HP


Viewing all articles
Browse latest Browse all 15932

Trending Articles



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