Triger a function on a change in doc

381 Views Asked by At

I want to run a Google App Script function every time a change is made to my Google Doc. I have found onChange and onEdit triggers which are only available for Google Spreadsheet. I am sure there must be an edit/change trigger for Google Doc as well.

1

There are 1 best solutions below

0
On

Unfortunately there are no onEdit(), onChange() triggers for Google Docs.

The triggers available for Google Docs are the following:

  • onOpen() triggers both simple and installable;

  • time driven triggers;

  • onInstall() simple triggers.

What you can do instead is to use a time driven trigger so in this way even though the changes are not directly triggering the execution, the trigger will still run how often you want it to.

Last but not least, you can file a Feature Request on Issue Tracker where you specify the details needed.

Reference