How can I delete container-bound scripts from multiple Google Documents or Sheets simultaneously without deleting the containers/files?

荒凉一梦 提交于 2021-02-19 02:21:30

问题


I created a container-bound script inside of a Google Document. Since then, I created a stand-alone script to replace this container-bound script, but I never deleted the initial container-bound project from the original document.

The new stand-alone script makes a copy of the original document using it as a template for a new document. Because I forgot to delete the initial project from the original document, a copy of the script was also made each time. I now have an extremely large number of copies of the script in my Google Apps Script Dashboard (script.google.com) as shown in this image:

I would like to delete every copy of this script from the dashboard. While I can right-click a single instance and select "Delete forever," like so:

I have not been able to find a way to select multiple instances simultaneously. Because I have such a large number of copies, selecting and deleting each instance one-by-one would take a prohibitive amount of time.

Perhaps I have simply not yet discovered how to select multiple instances. However, if it is not possible to select multiple instances in the dashboard, I am looking for a way to delete this script from each container programmatically without deleting the containers, themselves.

For instance, ideally, I would prefer to just type "TicketTemplate" into the search box within the Google Apps Script dashboard, select all, and delete all. But barring that possibility, I am hoping there is a way to do this programmatically using GAS. However, simply iterating through my files in Drive and deleting the files that contain this script is not an option. It must remove the script from the file without deleting the file itself.

I looked for a potential solution using GAS, say perhaps, using the DriveApp class, but I have been unable to figure out how to target the script within the container/file.

Thanks in advance for the help!

来源:https://stackoverflow.com/questions/52919838/how-can-i-delete-container-bound-scripts-from-multiple-google-documents-or-sheet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!