The .save contents command saves the table of contents to a defined item-ID. The item is saved in the same file as the current document. After saving, the item can be formatted and edited to create a customized table of contents.
.save contents item-ID
.sc
.chapter .save contents