I've moved this into the scripting forum for you...
When you say "how can I retrieve those index markers from my cells", what exactly do you mean? Delete them? Store their contents somewhere else?
If you're interested in processing indexes, see http://www.kahrel.plus.com/indesign/lists_indexes.html, especially, maybe, this one:
Thanks for your answer.
By "how can I retrieve those index markers from my cells" I mean I am in "myTable.rows[i].cells[x]" and I know when looking at my document with InDesign that the content of that cells contains some index marker. I would like to extract the content of the cell with the marker to keep that information.
So you want to get the text of a cell's contents, and the text of any index markers in that cell? That's not going to be easy. Although you can search a cell's contents for index markers (search for "~I"), when you find such a marker you can't get to its contents in a straightforward way: your script will see such markers as characters without content.
What you probably need to do is something convoluted like this:
1. get all page references,
2. find an index marker in the cell (this is a character);
3. cycle through the page references; for each reference, find its character reference in the text and compare it with the marker you found in the previous step. If the characters are identical, then get the reference's contents from its parent (which is a topic).
// Get all page references
page_refs = app.documents.indexes.topics.everyItem().pageReferences.everyItem().getElements();
// Find markers in a cell
app.findGrepPreferences = null;
app.findGrepPreferences.findWhat = "~I";
markers = myCell.findGrep();
// Cycle through page references
for (i = 0; i < page_refs.length; i++)
story = page_refs[i].sourceText.parent;
ch = story.characters[page_refs[i].sourceText.index];
if (markers == ch)
marker_content = page_refs[i].parent.name;
Naturally, you could expect more index markers in a cell, in which case you need to embed the for-loop in a for-loop that cycles through all markers. Anyway, I think you need something like this.
Thanks Peter for your answer, I can continue my script. :-)
That's exactly what I was looking for.
Thanks a lot Peter.