是否可以在应用程序脚本中为 Google 文档创建 onEdit/onChange 可安装触发器

Is it possible to create at onEdit/onChange installable trigger for Google Docs in App Script

目标:在 App 脚本中为 Google Docs 创建一个可安装的触发器,当 eventType onEdit 完成时触发。 (因此触发器侦听 onEdit 事件,当触发时它调用另一个函数,该函数在用户删除或添加段落时执行 X)

背景:Google Sheets 有 onEdit simple trigger, and the eventType on_edit. The eventType onEdit only supports Google Sheets. Regarding Google Docs the EventTypes and triggerBuilder methods for Google Docs (according to the docs) 只有 onOpen 和 Create。

我是 App Script 的新手,所以我希望有人知道如何绕过 triggerBuilder 仅支持两种方法这一事实。

唯一可用的 trigger for Google DocsonOpen()

一个解决方案是监控最后更改的时间戳是否使用触发器更改,例如像这样

DriveApp.getFileById('gdoc id').getLastUpdated()