-1

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

TheMaster
  • 45,448
  • 6
  • 62
  • 85
  • 2
    Error message text should be in the question itself, not in a screenshot. Include in your question a detailed description of all the steps you have taken, and their results. Otherwise we may suggest you do things you have already done - which is a waste of everyone's time. – tehhowch Oct 02 '18 at 14:01

1 Answers1

2

Not possible.

4. No triggers.The API cannot create Apps Script triggers.

TheMaster
  • 45,448
  • 6
  • 62
  • 85