I need to create a trigger when the user clicks a button in the extension. I set everything up, connected to the extension, and wrote this Google Apps Script code:
function CreateTriger() {
ScriptApp.newTrigger('MoveToInbox')
.timeBased()
.everyDays(1)
.atHour(9)
.create();
}
When I try to run this function from the Chrome extension, it returns an error that makes it clear that there is no access to such and to run the scripts remotely, but I don’t know how to resolve this.
Error text:
{
done: true,
error: {
code: 3,
message: 'ScriptError',
details: [
{
'@type': 'type.googleapis.com/google.apps.script.v1.ExecutionError',
scriptStackTraceElements: [
{ function: 'CreateTriger', lineNumber: 35 },
],
errorMessage: 'The script tried to perform an invalid action when calling via Google Apps Script Execution API.',
errorType: 'ScriptError',
},
],
},
}
https://developers.google.com/apps-script/reference/script/auth-mode
I found this page can be if you register these permissions you can make a request but I did not understand where to write it