I was trying to implement an improved solution of the google script suggested here: Google Spreadsheet: Script to Change Row Color when a cell changes text;.
However, after debugging my script, it occurred that my document is not accessible anymore. It seems that my script is erroneous and prevents my document from opening... The consequence is that I cannot disable/edit/remove the associated google script and I am stuck!
Do you have a way to solve this blocking issue?
Thanks,
Fabien
UPDATE: After further investigations, it seems that the reason of the problem is due to an infinite loop script called from the event trigger onOpen(). So my question can be reformulated to:
How do you stop a Google App script that gets into an infinite loop?
Can I use another script to kill the execution of this erroneous script ?
If you are in the code editor, and want to stop a script from running, you can click the "cancel" link in the toast display. Or you can click "View" -> "Executions" from the code editor and then terminate the script.
To run the script in debug mode, at the top of the editor click Debug. Before the script runs the line with the breakpoint it pauses and displays a table of debug information. You can use this table to inspect data like the values of parameters and the information stored in objects.
This is an old post but just in case:
Go to your Google Apps Script project page, within the My Executions tab: https://script.google.com/home/executions.
Filter by status so you can find the running project. On the right you have the three dots menu where you can terminate the running project.
Actually it is very simple. In your script loop, set a global var. Then when you want to stop it, wire up a script to set global var to false to a button image for example. Like this:
var RUNLOOP = true;
function YourLoop() {
if (RUNLOOP) {
// your code that does something every loop
}
}
function stopLoop() {
RUNLOOP = false;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With