Is there any problem in adding cross reference to the 4th level topic in Index creation in InDesign CS3 using JS. But it is added when doing manually.
var m_Index = doc.indexes.add();
var m_Topic1 = myIndex.topics.add(Ind1_Text);
var m_Topic2 = myTopic1.topics.add(Ind2_Text);
var m_Topic3 = myTopic2.topics.add(Ind3_Text);
var m_Topic4 = myTopic3.topics.add(Ind4_Text);
CRefTopic = "Fair educational practises act";
sText = app.selection;
var RefTopic = myTopic4.topics.add(CRefTopic);
The highlighted code shows the error: "Cannot create an additional item. Operation not permitted on this object."
Can anyone help on this.
It's not possible to add more than three subtopics, not even in the UI: there are only four topic levels in the several index panels. Are you maybe trying to add a cross-reference?
Yes, I'm trying to add cross reference in 4th level topic. Is it not possible through scripting?
It is. But you do that not by creating another level of topic and using literal text to refer to, but by adding a new topic and adding a cross-reference to that topic:
CRefTopic = m_Index.topics.add ("Fair educational practises act");
var RefTopic = m_Topic4.crossReferences.add (CRefTopic, CrossReferenceType.see);
or .seeAlso or some other cross-reference type; see the OMV.