Dawn
Dawn

Reputation: 23

Adding tasks from script

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?

Upvotes: 2

Views: 3007

Answers (1)

Arun Nagarajan
Arun Nagarajan

Reputation: 5645

  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

Upvotes: 3

Related Questions