I'm encountering a consistent issue with a custom "Extract Pages" script in InDesign, and I'm hoping someone here has seen something similar or can offer debugging advice.
Problem Overview:
The script works perfectly with all our bi-weekly publications, but it fails only on one specific document we use monthly. Here’s the behavior:
The script starts normally, extracting pages one by one.
As soon as it completes page 4 and begins processing page 5, the scripting window disappears behind InDesign.
From this point forward, the script halts execution silently. InDesign becomes fully responsive (as if no script is running), and a partially created temporary document is left behind.
No error messages, no crash reports — just a silent failure and incomplete output.
Reproduction Steps:
Run the script on the problematic monthly document.
Watch it script through the first four pages successfully.
On page 5, scripting UI disappears, and the process freezes (no progress, but InDesign is fully usable).
A temporary file is left open, but incomplete.
Additional Notes:
Attempting to run the script on just a subset of pages (e.g., 4–6) yields inconsistent results: sometimes it scripts only one page, sometimes none, but the temp file is still generated and then it freezes.
Under normal circumstances, while the script runs, InDesign is locked (as expected). During this failure, that lock doesn't occur — suggesting the scripting process has failed or been suspended.
This issue reproduces across multiple machines (Windows and macOS).
No recent changes to the script or InDesign version.
I’ve checked for:
Broken/missing links
Damaged glyphs
Overset text frames
Corrupt assets
Nothing seems out of the ordinary.
Questions:
Could something in the content on or around page 5 be silently crashing the script engine?
Are there known issues with modal dialogs or background script windows being suppressed or hidden behind InDesign?
Is there a way to trace what the script engine is doing or hook into logs during execution?
Could this be a memory leak or JS Engine timeout issue?
Any ideas on where to look next, or tools to help pinpoint where the script is failing, would be greatly appreciated.
Thanks in advance!