Maybe if you hide the document's window the script runs faster.
Might an idleEvent fit ?
Thank you both.
I check the idleTasks too.
A bit more information. We have a plugin that draws the wiggly lines on the PDF. The script simply activates the Dynamic Spelling and then exports to PDF. Once the PDF has been created we restore the Spelling preferences. The plugin relies on the Dynamic Spelling cache to do the drawing. The PDF creating is some times triggered before the Dynamic Spelling has completed.
I am wondering how the lines are draw.
Are all the words spell checked and then all the lines drawn or after each word is checked it's line is draw?
If it's the latter maybe you could use a suitably timed idle task to compare the list of spell errors from some form of kspell lists (If they exist).
If the length of the lists stay same then it might well be done.
The timing would have to be proportionate to the document length. It's not going to be 100% safe but it's a start.
Thanks. I think I will have to fix the plugin to calculate, or force the calculation of the cache.