-
1. Re: [CS3] Indexing, sort order and spaces
pkahrel Aug 22, 2010 12:06 PM (in response to GeraldHlasgow)InDesign sorts its indexes letter by letter, while what you want is word by word -- for details, see http://www.kahrel.plus.com/indesign/sort.html
Unfortunately, you can't change that behaviour in InDesign itself. But using the sorter in that link you can choose a sort strategy. That sorter, by the way, is a paragraph sorter, so if you have any subtopics you'd have to combine topics and subtopics into one paragraph, then sort, then resore the subtopics. It's not ideal (and slow), but at least it gives you the result you want (or a very close one, anyway).
Peter
-
2. Re: [CS3] Indexing, sort order and spaces
GeraldHlasgow Aug 22, 2010 12:41 PM (in response to pkahrel)Thanks, Peter.
I'll take a look at the script, but I suspect - as I do have quite a number of entries with sub-topics (and possibly some with sub-sub-topics) - that it might be just as easy for me to write my own code to handle it in the specific way I need it to work, now that you've clarified that I really can't do it in InDesign.
-
3. Re: [CS3] Indexing, sort order and spaces
Caleb Clauset Nov 8, 2011 9:06 AM (in response to GeraldHlasgow)The 'trick' to getting InDesign to consider white-space is to copy the first word of any multi-word index entry into its Sort By attribute. For example:
Black and White (sort by "Black")
Black, Cilla (sort by "Black")
Black Mountain (sort by "Black")
Blackburn, Tony (sort by "Blackburn")
Blacken
will result in your desired sort order.
-
4. Re: [CS3] Indexing, sort order and spaces
[Jongware] Nov 8, 2011 10:26 AM (in response to Caleb Clauset)Caleb Clauset wrote:
The 'trick' to getting InDesign to consider white-space is to copy the first word of any multi-word index entry into its Sort By attribute.
It does?
(Javascript:)
idx = app.activeDocument.indexes[0].allTopics;
for (i=0; i<idx.length; i++)
{
if (idx[i].sortOrder == '')
idx[i].sortOrder = idx[i].name.match(/^[^ ]+/)[0];
}
Edit: the comma should not be there in "Black, Cilia":
idx = app.activeDocument.indexes[0].allTopics; for (i=0; i<idx.length; i++) { if (idx[i].sortOrder == '') idx[i].sortOrder = idx[i].name.match(/^[^ ]+?[^, ]+/)[0]; }Yup, it does. I learnt something new today!
Message was edited by: [Jongware]


