문제

I'm not able to create tasks from script. Neither of the below are working.

var newlist = Tasks.newTaskList().setTitle("This tasklist is created from script");

var newTask = Tasks.newTask().setTitle("This task has been created from script");

I'm new to Google apps script. What am I doing wrong? I've also added the OAuthApp library. But I'm always getting

ReferenceError: "Tasks" is not defined.

Can someone tell me what I'm doing wrong?

도움이 되었습니까?

해결책

  1. You should create a project with the Tasks API enabled here - https://code.google.com/apis/console/
  2. Copy the key, and then in the Script Editor, in the menu go Resources -> Use Google APIs and paste in the key

enter image description here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top