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
Copy link to clipboard
Copied
I am keen to point out that this problem is not restricted to tables! It affects text in ordinary paragraphs as well. The first few occurrences are fine, but if the word is used very often in a long document, the index marker gets placed further and further from the word, even ending up in the paragraph after it.
This is clearly a programming error for which Adobe is responsible, yet they have done nothing to fix it in the decade or so since I began having to create indexes on a regular basis. It makes me very angry that they nevertheless deduct money from my account every month supposedly to finance development and bug-fixing.
Copy link to clipboard
Copied
It works fine in the UI - but ONLY if one item is added at a time - if a word / phrase is selected and ADD ALL is clicked in the dialog - it will produce the same error as if each found result is added through scripting.
Copy link to clipboard
Copied
But there is a workaround:
(order of the Tasks is wrong - 2nd should be executed first, then 1st in BatchMode, on all checkboxed results on the list)
You have to use INVOKE:
Name | Title | Area | ID |
Add new index entry | Add new index entry | Panel Menus:Index | 78098 |