My goal:
Every time I create a new spreadsheet, it should automatically give permission to "[email protected]" as an editor.
Research:
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet()
ss.addEditor('[email protected]');
}
Issue: Am actually using selenium automation to create the spreadsheet and gspread to read the values from it but the issue is gspread only reads spreadsheets shared with the service account...
I tried manually going to tools > script editor and run the program above, it worked. but when a new spreadsheet is created and I ran the same program but it didn't work.
Conclusion: Every time selenium creates a new spreadsheet it should automatically share it to the service account.