How to use a google apps script in multiple documents

后端 未结 4 1084
心在旅途
心在旅途 2020-12-03 03:13

I have a google apps script that I want to use in multiple documents. I also may want to change it later in those documents, so it is imperative that I use the same

4条回答
  •  旧时难觅i
    2020-12-03 03:44

    Sorry, my reputation was too low to add a comment. :( In Giuseppe's answer use this for find docs - minor change

    function findDoc(pros) {
      var ui =  DocumentApp.getUi();
      var pro = ui.prompt(pros, 'URL:', ui.ButtonSet.OK);
      var url = pro.getResponseText();
      return DocumentApp.openByUrl(url);
    }
    

提交回复
热议问题