【发布时间】:2016-02-12 15:15:24
【问题描述】:
我目前正在构建一个设置模式/侧边栏的工作表。我的问题是我确实需要从我的 *.gs 文件中的函数传递的多个值。
目前我知道我可以实现这个:
google.script.run.withSuccessHandler(myFunction).gasFunction('argument value');
索引.html
<html>
<head></head>
<body>
<script>
var hello = 'Not Working';
google.script.run.withSuccessHandler(indexLog).logMe('hello');
function indexLog(hello) {
console.log(hello);
}
</body>
</html>
气体脚本
function logMe(hello) {
return hello;
}
所以我处于多次运行连续方法以返回所需的所有参数的位置,即。
google.script.run.withSuccessHandler(indexLog).logMe('value 1');
google.script.run.withSuccessHandler(indexLog).logMe('value 2');
google.script.run.withSuccessHandler(indexLog).logMe('value 2');
我的值是单元格引用,但我需要一个范围而不是单个单元格值
然后我将获取这些值,并希望从中构建一个数组,以便在我的 for 循环函数中正确地迭代这些值。
提前致谢!
【问题讨论】:
标签: javascript google-apps-script google-sheets google-spreadsheet-api