Copy link to clipboard
Copied
Hello everyone!
to create an index reference entry without number page, I mean only with the cross-reference, like this:
human (see also beings)
person glossary
...
I need manually create a new entry with a Custom Cross-reference and add this manually:
but I need create hundreds. Please do you know a script to create a Custom Cross-reference?
Thanks so much.
1 Correct answer
Today I am replying on this thread Because I was also searching for the same.
I am replying for other needy person who might be looking for such script
////////////////////////////////////////////////////////////////////////////////////////////
///// For this sample script I am making this sample array for incoming data
var indexArray = [["Human","1st","Index)"],["Person","2nd","Index"],["Third","3rd","Index"],["Fourth Index","4th","Index"],["Fifth","5th","Index"]];
//=============================
Copy link to clipboard
Copied
Today I am replying on this thread Because I was also searching for the same.
I am replying for other needy person who might be looking for such script
////////////////////////////////////////////////////////////////////////////////////////////
///// For this sample script I am making this sample array for incoming data
var indexArray = [["Human","1st","Index)"],["Person","2nd","Index"],["Third","3rd","Index"],["Fourth Index","4th","Index"],["Fifth","5th","Index"]];
//=================================================================
var myDoc = app.documents[0];
try{
myDoc.indexes.everyItem().topics.everyItem().remove();
}
catch(e){}
var index = myDoc.indexes.add();
var customRef = null;
for(var i = 0; i < indexArray.length; i++){
topic = index.topics.add(indexArray[i][0]);
customRef = index.topics.add(indexArray[i][1]);
topic.crossReferences.add(customRef, CrossReferenceType.CUSTOM_CROSS_REFERENCE, indexArray[i][2]);
}
//=================================================================
////////////////////////////////////////////////////////////////////////////////////////////
Best
Sunil

