To stop the script, press ESC on Windows (or COMMAND-PERIOD on macOS). You can also select Edit > Stop Script. On macOS, Edit > Stop Script is available only when the script is running.