Clear code coverage while script is running takes very long

I’m again in a script towards InDesign and experiencing a very big slowdown while compiling…
I also noticed that the spinning ball also appears when I try to clear coverage while the script has been halted at a breaking point.

I now have about 500 lines of code… white lines included but again I’m talking to InDesign :slight_smile:

Also opening this script when it was saved with debugging on takes quite a while to open… maybe it’s possible to take a sample when opening the script to see what causes teh slowdown?

I’m wondering if you are using the older style application style, or the newer tell application id…

 tell application id "com.adobe.InDesign" -- Adobe InDesign CC

I once had some significant InDesign slowdown, but can’t recall if this was the primary nature of the fix. I do know InDesign terminology fails to load in some cases using the older style tell.


Yes, if you can get a Sample report while Script Debugger is displaying the hang, that would help a great deal in isolating the cause of the hang.

I can see two possibilities for hangs during load and recompile:

  1. Your script is referencing an application or file that AppleScript is having difficulty locating (perhaps the app/file is on a server somewhere)

  2. You have lots of nested code folding established and its taking SD a long time to reestablish this when loading/compiling the script.

Hey Ray,
How do you then address the different versions of InDesign. We have multiple versions running next to each other because on some machine we are still using older versions although we have multiple CreativeCloud accounts but the clients we work for sometimes work in older versions and instead of using idml as intermediate format we work in their native version if possible.

I’m using the old way or I even try to talk directly to the page or rectangle or document

using terms from application "Adobe InDesign CC 2018"
tell mChapterDoc
set mNewPageAppliedMaster to item 1 of (every master spread whose name is pNewPageMasterSpreadName)
set mNewPage to make page at end with properties {applied master:mNewPageAppliedMaster}
end tell
end using terms from


Here are samples when I changed it to enable debugging.
Then I ran my script and after that the spinning bal apeared even when changing the front app to SD from another application…

Samples (322.1 KB)

Mark I’m not alone experiencing the slowdown when using InDesign…
see threads on Shane also replied to this thread yesterday.

The id-form of tell addresses whatever version is open. Which is what the older form of tell does in many cases anyway. It’s a matter of making sure the version you want is launched (best done via path to the application) and all other versions are not.

Again, I’m not sure this will resolve your slowdown issues. But it does resolve some other problems I’ve seen.

Thank you for the samples. Can you are the script that causes these delays as well? If its sensitive, you can send it to me privately.

We believe we’ve corrected this problem in the latest Script Debugger 6.0.8 and 7.0 beta builds. For those of you in the beta testing group, please download these builds and see if you can reproduce the problem.

For those not in the beta testing program, you are welcome to join. If you prefer to wait for the release version, we’ll release the Script Debugger 6.0.8 maintenance release shortly.