简体   繁体   English

如何使用Google Appscript删除(日历或Gmail)任务?

[英]How to delete a (calendar or gmail) task using google appscript?

I'm trying to manage calendar / gmail tasks within a google appscript project. 我正在尝试在Google Appscript项目中管理日历/ Gmail任务。 All the integration work is done (Tasks API activation, authorization,...) 所有集成工作都已完成(Tasks API激活,授权等)

I have managed to create a tasklist and a task in this code, but can't figure out how to delete a task using the google Tasks API with the google appscript. 我已经设法在这段代码中创建了一个任务列表和一个任务,但是无法弄清楚如何使用带有Google appscript的google Tasks API删除任务。

The reference offers few samples, including uses of the list and the create methods, but none for deletion. 该参考资料提供了一些示例,包括列表的使用和创建方法,但没有用于删除的示例。 The Rest API reference give few more samples with java, PHP, Python and .Net implementation of the API, but still none for google appscript. 其余的API参考提供了有关该API的Java,PHP,Python和.Net实现的更多示例,但对于Google appscript仍然没有。

Here's what I've tried : 这是我尝试过的:

Tasks.Tasks.delete(tasklistid, taskid);

But the above code can't be saved in the appscript editor (due to the use of the javascript reserved word "delete" I guess). 但是以上代码无法保存在appscript编辑器中(我猜是由于使用了javascript保留字“ delete”)。

Any clue on where I could find a complete google appscript reference for the Tasks API or any "delete Task" sample ? 关于在哪里可以找到Tasks API的完整google appscript参考或任何“删除Task”示例的任何线索?

一段时间后,我尝试使用“我最好的客人”来解决该问题,并找到了替换Google来避免使用JavaScript“删除”关键字:

Tasks.Tasks.remove(taskList.id, task.id);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM