Have an account? Sign in
"*" indicates required fields
You agree that CreativePro Network may send you emails, including the newsletter selections above. You can unsubscribe at any time.
By signing in, you agree to our Terms of Use and acknowledge our Privacy Notice.
New user? Create an account
By signing in, you agree to our Terms of Use and acknowledge our Privacy Notice.
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.
This site uses cookies, but not the kind you eat. We use cookies to remember log in details, provide secure log in, improve site functionality, and deliver personalized content. By continuing to browse the site, you accept cookies.