MAXScript Introduction > General MAXScript Topics >

# Aborting Execution with the ESC Key

You can abort running MAXScript code by pressing and holding the Esc key. MAXScript may take a moment to respond, so hold the Esc key down until it does. The Esc key aborts any currently executing MAXScript code, whether it is in a scripted utility, a script controller, or running in the MAXScript Listener window. If the MAXScript code that is aborted is in a script controller, a Script Controller dialog is displayed showing the script used by the controller. Execution of the script controller will restart when you click the Close button.

MAXScript code locks out the rest of 3ds Max while it is executing. You cannot work interactively in 3ds Max while MAXScript code is running to avoid conflicts between code actions and your actions. If 3ds Max appears unresponsive at any time, it may be running MAXScript code which you can attempt to abort by pressing Esc . If you are testing scripts and 3ds Max doesn't return control to you within a reasonable time, press Esc to abort the code execution. You can also press Esc to abort a compilation of a multiline command in the MAXScript Listener window.

Use the MAXScript global variable escapeEnable in scripts to turn on and off the Esc key interrupt detection.

In 3ds Max 9 and higher, the default value was changed to false. It used to default to true in versions prior to 3ds Max 9.