var doc = app.activeDocument;
var textFrame = doc.textFrames;
var story = textFrame.parentStory;
var insertP = story.insertionPoints.lastItem();
var index = doc.indexes.add();
var topic = index.topics.add("LCD","L");
var pageR = topic.pageReferences.add(insertP);
I want to insert symbol to the under of table,but it inserted to the first cell of table.
This worked, but I have no idea why:
var pageR = topic.pageReferences.add(story.insertionPoints[-3]);
because this adds it to the end of the story, but if you change it to [-4] the marker is inserted at the position you would expect (4 positions to the left of the end of story).
The index markers are adjusted to the start of the word you're pointing to, but for some reason it fails. It must have something to do with the table, but I have no idea why.
var pageR = topic.pageReferences.add(story.words[-1]);
works again as expected.)