Back

If your email is not recognized and you believe it should be, please contact us.

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: changegrep misses final match #125753

    More info:
    The problem is somewhat intermittent: Occasionally the script works as expected, and sometimes changegrep misses the last two or even three matching paragraphs.
    This made me wonder if there’s a problem with asynchronous execution, such that the changegrep commands are running before the earlier commands are finished building the text frame.
    I moved the code snippet to the bottom of the script to execute after a couple of other things that take two or three seconds. This appeared to help–changegrep worked more often–but it’s not a “solution” because I need certain things to happen before others.
    I put the snippet back where it belongs, and inserted a “fit frame to content” command just before it:
    textframe.fit(FitOptions.FRAME_TO_CONTENT);
    This seems to have solved the issue … perhaps “fit” waits for InDesign to finish building the text frame before executing and allowing the script to continue.

Viewing 1 post (of 1 total)