Is it possible to extend InDesign's preflight with additional features through ExtendScript? I have a script that checks the document for runts and widows – It would make a lot of sense if the checks were displayed in the preflight-panel.
Not as far as I see it. You can manage preflight profiles and switch things off and on, but the switches are what you have available.
I have been digging through the documentation and couldn't find anything.
You might be able to get close with an event listener. Years ago I wrote a beforeSave handler to check for a peculiar workflow error. It displays an alert so that the page designer is aware of the problem and writes out a log file documenting the event.
You may as well build your own UI. Circa 2009, I worked with a digital publishing solution and we created a UI assistant that will let the designer know the possible issues in his document.
As preflight is scriptable, you could still use preflight reports and append your own preflight routines and introduce the final report to the user in your very own interface.
Thank you! That's a great solution. I have all of the check functions – I just needed a good way to fire them.
I went back and reviewed some old event-listener scripts to try to recall the ifs ands and buts. Seems to me that the main one is this: beforeClose fires after the document has been saved, if a save is needed.
If you intend to identify a problem and fix it in your script, beforeClose won't help. It looks like the problem is being fixed but then the document closes before it's saved. There may be a way around that, but I was never ever to find it. So, in these cases, I just attached my script to a beforeSave handler. The script runs before every save, not just the last one, but who cares?
Sometimes the fix is more complicated than what you want to tackle in a script. Widow and runt control may be like that. So that's where I'd use the beforeClose event listener. The handler checks for the problem, asks the designer if they want to deal with it now and, if yes, uses the .preventDefault() method to keep the file open.
Hope this helps. And hope I'm recalling these details correctly.
Hi Bob. That is super helpful – Thank you! The check is a little bit expensive to run on large documents, so i definitely have to confirm before running it.
Thank you for being so helpful!