Skip to main content
dublove
Legend
Jun 1, 2026 8:17 AM UTC
Answered

Is there a quick way to duplicate an “Contents Style” exactly?

Hi everyone.

Every time I need to create an index manually, I rename the “Contents Style” to “Index Style,” save the original ID file (e.g., A.indd) as B.indd, then open the A.indd file and load B.indd in “Contents Styles” panel.
This gives me two identical contents Styles.

It’s a bit of a hassle.
Is there a way to directly copy an identical Table of Contents Style?

 

    Eugene TysonCorrect answer
    Community Expert
    Jun 1, 2026 8:48 AM UTC

    TOCStyle.duplicate() is exposed in the scripting

    But it’s not in the UI - interesting

     

    // Edit these two values if your style names are different.
    var findName = "Contents";
    var newName = "Index";

    var doc = app.activeDocument;
    var source = doc.tocStyles.itemByName(findName);

    if (!source.isValid) {
    alert("No matching TOC style found.");
    } else {
    var copy = source.duplicate();
    copy.name = newName;
    alert("Copied \"" + findName + "\" to \"" + newName + "\".");
    }

     

    2 replies

    dublove
    dubloveAuthor
    Legend
    Jun 1, 2026 10:02 AM UTC

    Hi ​Eugene Tyson

    Thank you so much.
    I just remembered—it’s called Toc.
    Now I’ll be tinkering with it all day again.

    Translate
    Eugene TysonCommunity ExpertCorrect answer
    Community Expert
    Jun 1, 2026 8:48 AM UTC

    TOCStyle.duplicate() is exposed in the scripting

    But it’s not in the UI - interesting

     

    // Edit these two values if your style names are different.
    var findName = "Contents";
    var newName = "Index";

    var doc = app.activeDocument;
    var source = doc.tocStyles.itemByName(findName);

    if (!source.isValid) {
    alert("No matching TOC style found.");
    } else {
    var copy = source.duplicate();
    copy.name = newName;
    alert("Copied \"" + findName + "\" to \"" + newName + "\".");
    }

     

    Translate