2 Replies Latest reply on Jan 2, 2012 1:56 PM by Peter Kahrel

    [JS-CS5] How to delete a subtopic in an index ?

    Emmanuel Brochard

      Hi,

       

      I try to delete a subtopic in an index, like this for example :

       

      var index = app.activeDocument.indexes[0] ;
      var topic = index.topics[0].topics[0] ;
      $.writeln(topic.name);
      topic.remove() ;
      

       

       

      The last line throws an exception "Invalid object...".
      It seems to work with a topic (index.topics[0]) but not with a subtopic (index.topics[0].topics[0]).
      What is the correct method to remove a subtopic, please?

       

      Thanks in advance.

       

      --
      Emmanuel