Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thank you.
I have been digging through the documentation and couldn't find anything.
Copy link to clipboard
Copied
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.
If you already have the javascript code to identify the widows and runts, I'd think it would be pretty simple hook it up to the beforeSave event. The more complicated question would be how to report the results back to the designer.
Bob
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thank you! That's a great solution. I have all of the check functions – I just needed a good way to fire them.
Copy link to clipboard
Copied
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.
Bob
Copy link to clipboard
Copied
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!