Skip to main content
frameexpert
Community Expert
Community Expert
February 8, 2018
Answered

ExtendScript limit on how many paragraphs can be processed

  • February 8, 2018
  • 1 reply
  • 1092 views

I received a bug report on my FindChangeFormatsBatch ExtendScript script yesterday where the issue was a crash on two particular documents. Both documents contain a large amount of tables and, because each cell contains at least one paragraph, a large number of paragraphs. One document had over 12,000 paragraphs and the other over 14,200 paragraphs.

I still wasn't sure if the number of paragraphs was the problem so I set up a simple, Portrait document containing a large number of paragraphs. Each paragraph was empty except for an autonumber so I could keep track of the number of paragraphs. Here is the code I ran:

#target framemaker

var doc = app.ActiveDoc;

countPgfs (doc);

function countPgfs (doc) {

   

    var pgf, counter = 0;

   

    pgf = doc.FirstPgfInDoc;

    while (pgf.ObjectValid () === 1) {

        counter += 1;

        pgf = pgf.NextPgfInDoc;

    }

    alert (counter);

}

The code always ran the first time, even with over 14,000 paragraphs in the document. But it would hang and crash FrameMaker if I tried to run it a second time. I cut my paragraph count back until I could run it over and over without hanging. I ended up at around 12,200 paragraphs, give or take a few. Once I got over that mark, FrameMaker would hang on the second run of the script.

I wonder if anyone else has experimented with ExtendScript and processing large numbers of paragraphs. Any feedback or comments will be appreciated.

-Rick

This topic has been closed for replies.
Correct answer Wiedenmaier

This is a Memory leak in ExtendScript Core and related to all Adobe Products using ExtendScript.

This doesn't effect FDK Clients/plugins and so this has no side effects to FrameScript.

Hopefully Adobe will solve this Problem very soon. Traversing all paragraphs in a document is a very common use case.

1 reply

Klaus Göbel
Legend
February 8, 2018

Hi Rick,

this is a known bug.

Re: Framemaker 12 and Framemaker 15 get stuck after one complete traversal of all Paragraphs in the doc

I've tested it several times. After about 500 Pgfs FrameMaker crashes.

frameexpert
Community Expert
Community Expert
February 8, 2018

Thank you Klaus. I forgot about that thread. I have a lot of scripts that completely traverse all paragraphs that don't stall, except when the number of paragraphs gets large.

www.frameexpert.com