• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

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

Community Beginner ,
Aug 08, 2017 Aug 08, 2017

Copy link to clipboard

Copied

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.

TOPICS
Scripting

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2017 Aug 09, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 09, 2017 Aug 09, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 09, 2017 Aug 09, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 09, 2017 Aug 09, 2017

Copy link to clipboard

Copied

Yet another update: I tried to restart the program with open wrapped in a try catch only to get the same error and a couple blank tabs. clicking on one resulted in the entire program crashing. This one generated much more crash log data if its needed.

emptyProjectTabs2.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 10, 2017 Aug 10, 2017

Copy link to clipboard

Copied

extendersGame  wrote

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.

May I ask what's the purpose to open and close a template 100,000 times in one session?

I mean you say that you want to create "specialized books". And you are testing just with templates and do nothing with them. I would allow InDesign some time between opening, processing and saving a document.

Also consider a restart of InDesign after a while. Let's say after creating and saving 1,000 documents. Don't know the OS platform you are on, but that should be doable with AppleScript on Mac OS X or VB on a Windows system.

Or use InDesign Server for the task…

Regards,
Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 15, 2017 Aug 15, 2017

Copy link to clipboard

Copied

Hello Laubender, The script I gave as an example is just a condensed version of the script designed to only incorporate parts of the script needed to make the bug show up. My actual script generates book length documents who's content differ by user and saves them to an out folder.

I don't need to make 100,000 at a time, that was just a number I gave it to try to reach before crashing. My actual script tends to reach between 40 and 1500 completed books but since this lower bound is potentially lower then the amount of orders I can receive in a couple hours space, I can't trust it to be left alone building over night.

The normal script goes about 20 seconds between open() calls but I can add in some sleep time if you think it will help.

I am using a PC so setting up a restart cycle might be a challenge though I can probably cobble something together if I have to.

I have never heard of Indesign server, I will look into it though solving the problem under the current set up would be preferable.

Thanks for your time and suggestions!

-Thomas

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2017 Aug 16, 2017

Copy link to clipboard

Copied

Hi Thomas,

there is a dedicated Adobe forum for InDesign Server:

InDesign Server Developers

Here some more info:

Document layout design and automated publishing software | Adobe InDesign CC Server

Regards,
Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

LATEST

Thank you for the links and suggestion. I'll see about looking into it. I will of course, continue to also pursue this particular bug as there isn't any reason InDesign shouldn't be able to do this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 09, 2017 Aug 09, 2017

Copy link to clipboard

Copied

Try insert $.gc() at top of script

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 09, 2017 Aug 09, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 09, 2017 Aug 09, 2017

Copy link to clipboard

Copied

have you try uninstall and reinstall?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 09, 2017 Aug 09, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 09, 2017 Aug 09, 2017

Copy link to clipboard

Copied

I have tried uninstalling InDesign with no change. On a related note, I'm not sure how to set estk back to opening with cc 2017 by default over older versions so if you happen to know, I would appreciate the tip.

I'll be away till Tuesday but if I get any other suggestions, Ill try them then and report back here with the results. Thanks again for all the suggestions so far.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines