Remove all Object Styles, Paragraph Styles, Character Styles
Attempting to remove all Object Styles, Paragraph Styles, Character Styles while not affecting text frame attributes or text attributes currently present in the indd.
Basically keeping the visual presentation and position of all frames and it’s text content intact while removing all styles sheets in the document.
The below code successfully removes character styles and paragraph styles but:
• It gives an error on the paragraph style (yet removes them except the [Basic Paragraph] default style) (screenshot below).
• doesn’t remove object styles at all.
What I would like is to not get that paragraph error somehow?
In addition to obviously removing all Object Styles.
Any leads are greatly appreciated.
*Script below.
Error thrown regarding Paragraph Style default style issue.

Current 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
.remove(); }
var pghs1 = myDoc.paragraphStyles.length;
for(var j=pghs1-1; j>0; j--) //j++ replaced here by j--
{
myDoc.paragraphStyles
.remove(); }
var objs1 = myDoc.objectStyles.length;
for(var j=objs1-1; j>0; j--) //j++ replaced here by j--
{
myDoc.objectStyles
.remove(); }
