Debugging Scripts

T-HSCP-001-003

If you are having issues with a script you're working on, you can debug your script using the Run Script Button Debug command. With the Debug command, you can run a specific function in your script, or an entire script, through a debugging interface.

To select which function in which script the Debug command should debug, you must use the Set Target Function Button Set Target command, which will prompt you to select a script and a function. Once you've done this, every time you use the Run Script Button Debug command, it will debug the function you set as your target. If you need to debug a different function or script later, you will have to use the Set Target Function ButtonSet Target command again to change the target script and function. This allows you to work on and repeatedly debug one function at a time when working on a script.

NOTES
  • If you use the Run Script ButtonDebug command without setting a target first, you will be prompted to set a target. The selected target will persist until you use the Set Target Function Button Set Target command to change it.
  • The target script and function is also used by the Run command.
  • To debug a script from the global scope rather than debugging a specific function, you can select <Nothing> as the target function.
  • Although you can run a script at the global scope, you cannot create a toolbar button that runs a script at the global scope. Toolbar buttons can only run specific functions within a script. Hence, debugging a script at the global scope should be done for testing purposes only.