This simple example uses Advanced Google services with Task API version 1.
You can enable this API from menu Resources – Advanced Google services into your Google Apps Script project.
The script is simple, takes title and id of your tasks, and is put on logs system.
You can view the output from the menu: View – Logs.
1 2 3 4 5 6 7 8 9 10 11 12 | function listTaskLists() { var taskLists = Tasks.Tasklists.list(); if (taskLists.items) { for (var i = 0; i < taskLists.items.length; i++) { var taskList = taskLists.items[i]; Logger.log('Task: title "%s" and ID "%s" was found.', taskList.title, taskList.id); } } else { Logger.log('No task'); } } |