Can't remove subtopics in index via JSX - Invalid request
app.activeDocument.indexes.item(0).topics.everyItem().topics.everyItem().remove();
Considering the above code, I am attempting to remove subtopics from a multilevel index in InDesign via scripting. I get an Invalid Object for this Request error. I have tried iterating through every top level topic, to the second tier, to the third tier, and removing the items in the third tier (iterating downwars using while(k--)) but I still get an invalid object for every one. There is no fourth level; I can get thirdLevel[k].name and it is a Topic, but it won't let me delete them.
Anyone have any thoughts? Thanks. Edit: Edited out the error in the everyItem snippet above; still same result.

