我可以从Chrome扩展程序执行Google Apps脚本代码吗?

时间:2013-08-23 14:09:35

标签: google-chrome-extension google-apps-script

我想写一个Chrome扩展程序,允许用户直接从多功能框发送电子邮件。是否可以直接执行Google Apps脚本代码,例如Chrome扩展程序中的Gmail Services API

1 个答案:

答案 0 :(得分:10)

是的,你可以但有一些限制 如果您将应用程序脚本代码发布为可公开访问的Web应用程序,则可以向webapp URL发出GET请求以执行Apps脚本代码。

e.g

doGet(e){
//use e.parameter here
//write your apps script code
return ContentService.createTextOutput('your return content');
}

发布后,说你有一个像

这样的网址
https://script.google.com/macros/s/djihwerd98ejdeijded/exec

现在从您的Chrome应用程序发出请求

GET https://script.google.com/macros/s/djihwerd98ejdeijded/exec?param=value
相关问题