Toivo Säwén
Toivo Säwén

Reputation: 2041

Alert in Google Script editor

I am making some quick scripts to manipulate spreadsheets in my Google Drive. However I want to avoid the script accidentally running and modifying data before I know it works, or running additional times after it has done its job. Thus I would like to have a popup button/alert in the Google Script editor where the user (typically me) confirms that they want to continue running.

I have tried things such as getUi().alert(), but it seems to be more used when I distribute the script as an app. Any hints?

Upvotes: 0

Views: 533

Answers (1)

Amit Agarwal
Amit Agarwal

Reputation: 11278

You cannot get alerts inside the Apps Script editor.

An option is that you add the debugger; statement in your code and then run the script in debug mode (Go to Run > Debug Function > function name).

The execution will automatically pause at places where the debugger statement exists.

enter image description here

Upvotes: 2

Related Questions