Is it possible to read the contents of a Google Apps Script from another Script

二次信任 提交于 2019-12-05 11:21:26

It is, in fact, possible. This gets Code.gs:

function myFunction() {
  throw ScriptApp.getResource("Code").getDataAsString();
}

There is no way to programmatically retrieve the contents of a ".gs" file. You can only ask for files with ".html" extension and potentially you can return it in a project.

This request has come up in the context of allow local development or Git integration to provide an API way to get/set script source in a file. Please put your comments in this issue tracker request or log a new one if it makes sense .

http://code.google.com/p/google-apps-script-issues/issues/detail?id=1108

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