It’s complicated. I am using the method of creating two numbered list styles, where the first level list is not actually numbered, but since it is formatted to “start at 1”, following paragraphs, the real numbered lists (level 2), will automatically restart their numbering. And this book is full of them. I would do this, but my experience has been that the numbering doesn’t always restart as it should in an ePub export. So I would have to export a separate ID doc for the ePub and go through and override the style of every numbered list to restart at 1.
So assume I did these overrides in the original ID doc. Since it’s a print layout, certain other overrides have to be employed for the sake of copyfitting, e.g., changing the keep options on a single paragraph to properly fill out a page or break at a different point on a page, increasing tracking to improve copyfitting. These overrides I would want to remove before the export to ePub as in an ePub such considerations as copyfitting are irrelevant and could affect the flow of the text.
So the question is, how would I clear all overrides but the overrides to the numbered list style?
var myParas = app.activeDocument.stories.everyItem().paragraphs.everyItem().getElements(),
P = myParas.length, p;
for ( p = 0; p < P ; p++) if ( myParas[p].appliedParagraphStyle.name != “NumberedListStyle” ) myParas[p].clearOverrides();