I am trying to run a simple script that opens a Google Spreadsheet and a Google Form in the same standalone Apps Script file. It seems like the script can only give authorization to the FormApp, but not the SpreadsheetApp. The authorization scope does not grant permission to manipulate the spreadsheet.
The error is as follows:
You do not have permission to call openById
If I run both lines separately (by removing one line or another), then the script works normally.
Follow the example code.gs:
function Code(){
var spreadsheet = SpreadsheetApp.openById("<spreadsheet_id>")
var form = FormApp.openById("<form_id>")
}
Follow the script scopes listed:
Note that the App Script is not asking for the Spreadsheet scope.
The weird part is If I create a bounded script into a Spreadsheet or a Form, then the script works normally. The problem only happens on a standalone script.
I am not using the @OnlyCurrentDoc annotation