How to debug AppleScript error: "Expected “*)” but found end of script." I am going mad trying to fix the following error in my AppleScript code:



What this error means is that I have opened a comment somewhere in the code with a (* but I have forgot to close it with a *).

The code contains over 4000 lines and hundreds of comments. I have looked through the code for hours trying to find this missing closure but I cannot find it.

Is there some method or application that can inform me of the exact line of the code that is responsible for the error?
There's a syntax highlighting package for AppleScript for the text editor Atom. It works better than the one provided with Script Editor, as it will correctly identify multiline comments, even if the script itself doesn't compile:



From there, it should be easy to identify the missing *).