Answer the question
In order to leave comments, you need to log in
How to display a message in the Google Scripts editor using Browser.msgBox()?
I just started studying google scripts, and on the first attempt to display "Hello world!" I got an error that I don't know how to fix.
Here is the suggested code from the tutorial:
function helloWorldBrowseer() {
Browser.msgBox("Hello world!");
}
10:58:29
Error
Exception: Cannot call Browser.msgBox() from this context; have you tried Logger.log() instead?
Answer the question
In order to leave comments, you need to log in
If the script is not attached to anything (document) then it can be assumed that it is executed by itself, without UI . Where to display the message? So he offers to write to the logger.
If you really need to view the message, then do it from a script attached to a document, such as a table. And there already take the document, its UI and call alert ()
SpreadsheetApp.getUi().alert("h,w!");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question