Joel is spot-on. My script looks for all text anchors (hyperlinkTextDestinations for JavaScript) -- that's the easy part. But the anchors don't tell you what they're used for, so you have to bend over backwards to find whether they's used for cross-references, hyperlinks, bookmarks, or whatever.
Using the F/C window is useless: you can look for <FEFF> but you can't do anything with what you found. A script thinks that though what you find has length 1, it has no content.
I don't know in what way you want to manage ankers and cross-refs, but to find all text anchors that are part of cross-references, you should collect all hyperlinks, then get those whose destinations are a HyperlinkTextDestination and whose source is a CrossReferenceSources. Along these lines:
hlinks = app.activeDocument.hyperlinks.everyItem().getElements();
for (i = 0; i < hlinks.length; i++) {
if (hlinks[i].destination instanceof HyperlinkTextDestination
&& hlinks[i].source instanceof CrossReferenceSource) {
// Your custom function
doSomethingWithTextAnchor (hlinks[i].destination);
}
}
... View more