Copy link to clipboard
Copied
Hi,
can anyone confirm that? If you select the word »sit« (attached document) and create an index entry using script, the page reference will be created after the word.
var _doc = app.activeDocument;
var _docIndex;
if(_doc.indexes.length === 0) {
_docIndex = _doc.indexes.add();
} else {
_docIndex = _doc.indexes.firstItem();
}
var _textObj = app.selection[0];
var _parentTopic = _docIndex.topics.add("Topicname");
var _pageRef = _parentTopic.pageReferences.add(_textObj);
MacOS and InDesign CC2019 14.0.1
Roland
Yes, that is a bug. Report ASAP at Adobe InDesign: SDK/Scripting Bugs and Features: Top (27 ideas) – Adobe InDesign Feedback as it seems only related to scripts (using the same selection and the Index panel works as expected).
I find inconsistent results (offsets of one or two characters after the selected word) when the table above is 3 or more rows – but there is more to this, because the problem seems to shift or disappear when the word is more than 4 characters!
Tested in CS4, so it seems a lo
...Copy link to clipboard
Copied
Yes, that is a bug. Report ASAP at Adobe InDesign: SDK/Scripting Bugs and Features: Top (27 ideas) – Adobe InDesign Feedback as it seems only related to scripts (using the same selection and the Index panel works as expected).
I find inconsistent results (offsets of one or two characters after the selected word) when the table above is 3 or more rows – but there is more to this, because the problem seems to shift or disappear when the word is more than 4 characters!
Tested in CS4, so it seems a long-running bug.
Copy link to clipboard
Copied
Thanks Jongware! Reported.
Copy link to clipboard
Copied
Hi Roland,
I can confirm the bug.
Thanks for reporting this.
Hm. Just trying to make out the "rules" of this misbehavior.
The scope of the bug seems to be the story.
Numbers of table rows before the text selection and numbers of characters selected are a factor.
Regards,
Uwe
Copy link to clipboard
Copied
If there is only one table before the text selection in the same story one could see what words are affected.
With a table of one row: No bug.
A table of two rows affects words with one character.
A table of three rows affectes words with one or two characters.
Four text frames, four stories, four tables with different row lengt:
I selected every single word and ran the script for doing an index topic.
The issue gets more complicated if several tables are positioned in the story before the selected text.
Regards,
Uwe
Copy link to clipboard
Copied
Hi Uwe!
This topic has already been mentioned here in 2010, I found out in the meantime (by a hint on Twitter): https://www.hilfdirselbst.ch/foren/Skript_zum_Index_generieren_P430412.html
Another weird example: many table rows and not enough insertion points after the selection in the story.
Roland
Copy link to clipboard
Copied
Tested also this case and can confirm that the index marker is created in a text cell.
Text selected is the "A" that comes after the table in the same story:
Regards,
Uwe