更新时间:2022-12-23 15:12:46
如果要使用Google Apps脚本检索任务列表ID,该示例脚本如何?
If you want to retrieve the tasklist IDs using Google Apps Script, how about this sample script?
要使用示例脚本,请在运行脚本之前,先在Advanced Google Services和API控制台上启用Tasks API,如下所示.
In order to use the sample script, before you run the script, please enable Tasks API at Advanced Google Services and API console as follows.
启用Tasks API后,请运行以下脚本.
After Tasks API was enabled, please run the following script.
function myFunction() {
var taskLists = Tasks.Tasklists.list().getItems();
var res = taskLists.map(function(list) {
return {
taskListId: list.getId(),
listName: list.getTitle(),
};
});
Logger.log(res)
}
如果这不是您想要的结果,我表示歉意.
If this was not the result you want, I apologize.