There are many third party script debuggers available. A quick search of the internet using the keywords “script debugger” will reveal several.
The debbugger you choose should enable you to do the following:
View the source code of the script you are debugging.
Control the pace of script execution with break points and stepping.
View and change variable and property values with the Command Window.
View and control script flow with the Call Stack Window.
View the script objects of the targeted applications.