Send All Google Tasks in a Task List to Google GMail

// Constant TASKLIST = "Ittichai's list"; // -

function getTasklistId_(tasklistName) { var tasklistsList = Tasks.Tasklists.list; var taskLists = tasklistsList.getItems; for (tl in taskLists) { var title = taskLists[tl].getTitle; if (title == tasklistName) { return taskLists[tl].getId; }       }      }

function main { // Get the task ID defined in TASKLIST var tasklistid = getTasklistId_(TASKLIST) // Get all tasks in the task list var tasks = Tasks.Tasks.list(tasklistid).getItems;

for(var i in tasks){ var tasktitle = tasks[i].getTitle; var tasknotes = tasks[i].getNotes; MailApp.sendEmail('ittichai@gmail.com', tasktitle, tasknotes);

} }


 * See this note to understand what needs to be done to run this script - http://ittichaicham.com/wiki/Create_Google_Tasks_by_sending_email_to_Google_GMail