-
1. Re: Deleting Index Topics
Pickory Jul 3, 2013 3:01 AM (in response to GJ du Toit)Hello,
You could try this script.
//1. Peter Kahrel, Mar 20, 2013 10:09 AM in reply to olfar
try {
aDoc.indexes[0].topics.everyItem().remove();
} catch (_) {
}
P.
-
2. Re: Deleting Index Topics
GJ du Toit Jul 3, 2013 3:34 AM (in response to Pickory)Thanks. That seems to be what I need, but it doesn't seem to do anything. I saved it as .jsx and put it in my ID scripts folder, but when I run it, nothing happens. Am I doing something wrong?
-
3. Re: Deleting Index Topics
Pickory Jul 3, 2013 3:47 AM (in response to GJ du Toit)oops, sorry, replace aDoc with app.documents[0]
edit to say.
Now I am miss quoting. This is what I should have siad in the first place.
try {
app.activeDocument.indexes[0].topics.everyItem().remove();
} catch (_) {
}
http://forums.adobe.com/message/5164126#5164126
P.
-
4. Re: Deleting Index Topics
GJ du Toit Jul 3, 2013 4:47 AM (in response to GJ du Toit)Ah, I think that works, but it crashes InDesign, probably because it deletes those topics that crash ID when deleted manually. However, as a clumsy workaround I generated an index consisting of the topics that couldn't be deleted, and saved that so that I can remove those entries from the final index (in the end, there were only six).
These are malformed entries. They all have the form "Company, see" or "Company, see also", with no further reference. They can't be deleted (ID crashes), nor can they be edited: I inserted a topic with an actual marker in the text and tried to make them refer to that, but when I click OK the cross-reference remains unchanged. Seems this document is stuck with those forever.
But thanks for your help. I think the script will come in handy some time.
-
5. Re: Deleting Index Topics
Pickory Jul 3, 2013 4:53 AM (in response to GJ du Toit)Hello,
I would be tempted to save the file to IDML and reopen it.
P.
-
6. Re: Deleting Index Topics
GJ du Toit Jul 3, 2013 6:12 AM (in response to Pickory)That struck me as a good idea. But ID crashes when I do that too. Probably caused by the same bad index topics?
-
7. Re: Deleting Index Topics
Pickory Jul 3, 2013 6:19 AM (in response to GJ du Toit)If you can share the document, I would be happy to have a go.
P.
-
8. Re: Deleting Index Topics
GJ du Toit Jul 3, 2013 8:12 AM (in response to GJ du Toit)Thanks, that's kind of you. Please don't waste any time on it, the problem has become mostly academic. Only four problem entries remain (I've since added a whole lot of additional entries, for the current text):
Company
foreign See
Foreign company See also
MOI See
NPC See
But I'll be interested to know what you make of those entries. The document is available at:
https://dl.dropboxusercontent.com/u/9069705/Consumer%20Law%20Unlocked%20Folder.zip
-
9. Re: Deleting Index Topics
Pickory Jul 3, 2013 8:46 AM (in response to GJ du Toit)Hello,
Well, ID6 Mac desktop crashes while trying to open the document. ID 6 Mac server can open the document and create a pdf but crashes if I try to delete the topics.
Failed, sorry.
P.
-
10. Re: Deleting Index Topics
P Spier Jul 3, 2013 8:50 AM (in response to GJ du Toit)You might try exporting the story(s) to ID tagged text and import them into a new file and see if that cleans things up.
-
11. Re: Deleting Index Topics
GJ du Toit Jul 3, 2013 8:42 PM (in response to P Spier)First I must stress that this isn't at all critical; hardly a problem at all, so please don't break you head and waste time over it (all I have are four bad index cross-references that I don't want and can't delete). Ortherwise the document is fine, and the new index is fine (I'll delete the unwanted cross-references after generating), and the document doesn't crash InDesign.
I'm afraid exporting to tagged text won't help because the problem topics and cross-references aren't markers in the text. Page references exist as markers in the text, but topics without references, or with cross-references only, live elsewhere in the InDesign document, not as text markers.
-
12. Re: Deleting Index Topics
P Spier Jul 4, 2013 5:55 AM (in response to GJ du Toit)The point here is that if you can export to tagged text you should only get those things actually inthe text stream, and by importing into a new file you ought to be able to bypass any corruption still present in the old one. I understand it isn't critical this time, but it's a technique you might want to try to see if it has potential for the next time this happens when maybe you won't be as lucky.
-
13. Re: Deleting Index Topics
Pickory Jul 4, 2013 6:29 AM (in response to P Spier)Hello,
I think I would try and rebuild the document.
That said, I have a plugin that will remove all topics from an index, including this one.
Would you like your topics zapped?
edited to say, now I can't add any index entries, so I think the plugin is a bit dangerous!
P.
-
14. Re: Deleting Index Topics
GJ du Toit Jul 4, 2013 6:56 AM (in response to P Spier)Yes, you're quite right. If I exported to tagged text and reloaded the text into the same document, the index topics will still be there. But of course, after exporting to tagged text I should start a new document, import text styles and master pages from the troublesome document, and then import the tagged text. I've just tried that, and the topics are indeed gone. (But for now, I'm staying with the old one; I'm too lazy to do all the additional little things required to get the new document into shape!)
Thanks for you input. What I'll remember in future is: when starting a new document to be based on an existing one with an embedded index,start a new document and import the styles rather than just save it under a new name, delete the text, and import the new text.
We learn!
-
15. Re: Deleting Index Topics
GJ du Toit Jul 4, 2013 6:57 AM (in response to Pickory)Oh dear . . . sounds like a plugin to avoid!



