1
votes

So I began experimenting with Google Apps script (to automate a google slide maker), so I created a test function. This is all the code:

function myFunction() {
  Browser.msgBox("Hello World");
}

This gives me an error: Exception: Cannot call Browser.msgBox() from this context; have you tried Logger.log() instead? (line 2, file "Code"). Before I verified and allowed authorization, when I typed Browser. it would give me options. After I authorized, nothing popped up. This means that the authorization is the problem. Does anyone have a fix for this?

Also, google never made me type "continue" during the authorization.

1

1 Answers

2
votes

The Browser class is only available for Google Sheets, not Google Slides. See its documentation:

This class provides access to dialog boxes specific to Google Sheets.

The methods in this class are only available for use in the context of a Google Spreadsheet. Please use Google Workspace dialogs instead.