Skip to main content
Participating Frequently
August 8, 2017
Question

app.open() crashes InDesign after repeatedly opening a template

  • August 8, 2017
  • 2 replies
  • 2092 views

So I was writing a script that batch builds specialized books from a list of order files when I ran into an odd issue with InDesign crashing, (no exception is reported when run through ExtendScript toolkit, the program just crashes complete with a windows popup of "Adobe InDesign CC 2017 has stopped working" )

After an extensive debugging process, I determined that the crash always happens at app.open()

Further testing showed that it does not matter if its opened as a copy, or which template it is, just that it is opened many times in the same script.

I proceeded to test on several computers with windows 7 and 10, varying hardware, and varying versions of InDesign CC 2017 all with the same results save one that offered this error report:

Problem signature:

  Problem Event Name: APPCRASH

  Application Name: InDesign.exe

  Application Version: 12.0.0.81

  Application Timestamp: 57f545c7

  Fault Module Name: DV_WidgetBin.dll

  Fault Module Version: 12.0.0.81

  Fault Module Timestamp: 57f54502

  Exception Code: c0000005

  Exception Offset: 000000000003b755

  OS Version: 6.1.7601.2.1.0.256.48

  Locale ID: 1033

  Additional Information 1: 937c

  Additional Information 2: 937cd28da0d9cc614dbe2c8fd27dd239

  Additional Information 3: 2bc1

  Additional Information 4: 2bc19be4be45607293e6e95449d7f364

I have compressed the code down to 8 lines with the same result. If you want to test it,

you will also need an indt file with the name blank in the same directory. This can be as simple as a 1 blank page template

#target "Indesign"

var directoryRoot = (new File($.fileName)).parent;

var template = File(directoryRoot + "/blank.indt");

for (var m = 0; m < 100000; m++) // arbitrarily high number it never reaches

{

    var doc = app.open(template, true, OpenOptions.OPEN_COPY); // The program crashes on this line

    app.activeDocument.close(SaveOptions.NO);

}

This version tends to run for about an hour on my machines and the original batch script tended to make between 40 and 1500 books before crashing.

I could not find any similar reports in the forums but if anyone knows a solution I would really appreciate it as this bug is rather debilitating to my planned work flow.

This topic has been closed for replies.

2 replies

Stefano Biancardo
Participant
August 9, 2017

Try insert $.gc() at top of script

Participating Frequently
August 9, 2017

unfortunately that doesn't seem to have helped. The whole program is crashing again. But thanks for the suggestion!

Participating Frequently
August 9, 2017

have you try uninstall and reinstall?


I have not and the fact that the same thing happens on other computers I have tried hints to me that its not an installation problem but I can certainly try it if you think it might help. Also if anyone else is so inclined to run the test, I would appreciate knowing if it works for them.

Community Expert
August 9, 2017

Hi,

since you open an indt file I guess you would not need argument 3 with the app.open() method.
And since argument 2 is by default the value that you want just use argument 1.

Hope, that helps.

Regards,
Uwe

Participating Frequently
August 9, 2017

Testing it, it got about 12000 in and then crashed but this time it crashed as an exception reported to ESTK. Not a very helpful one mind you: "Uncaught exception". but that does seem to be progress.

Participating Frequently
August 9, 2017

I should add, it left behind a few un-closed documents. the first one closed right away, the second one appears to be refusing to let me close it before saving it, the last one which it had been working on at the time of crash hung for a minute but then allowed me to close it prompt free.