Paul Bramley
My feedback
1 result found
-
1 vote
An error occurred while saving the comment An error occurred while saving the comment Paul Bramley commentedThe attached file is a .zip file renamed with a .txt extension to try and get it to upload to this supidly restricted site.
It contains
Book.indb - this is what the VB script uses to open the other documents
TOC - empty document that the VB script attempt to create the table of contents in
MainDoc - the document containing the entries that will be placed in the table of contents
GenerateIndex.vbs - script that attempts to create the table of contents. Changing showContentsDoc to True allows it to work.An error occurred while saving the comment Paul Bramley commentedUPDATE:
I've managed to narrow down what causes the issue. If the document that is to contain the table of contents is opened with the showingWindow parameter set to False, then the crash can occur. When this is set to True, then creating the TOC appears to work OK.The attached files illustrate this. The script assumes that the Book.indb file is already open in InDesign. The TOC.indd file should NOT be open.
WARNING: running the script is likely to crash InDesign.
There are other factors that seem to affect whether InDesign will crash or not. The number of TOC entries and the length of the text for the TOC entries influences if CreateTOC will crash or not (e.g. remove the Barrow42 from the end of MainDoc, and CreateTOC seems to work fine - regardless of if the TOC document is hidden or not). Also if the TOC already exists, then CreateTOC does not crash.
Paul Bramley shared this idea ·
The same issue and workaround also occurs with Index.Generate.