Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 谷歌应用程序脚本-使用实用程序类_Google Apps Script - Fatal编程技术网

Google apps script 谷歌应用程序脚本-使用实用程序类

Google apps script 谷歌应用程序脚本-使用实用程序类,google-apps-script,Google Apps Script,我正在学习谷歌应用程序的应用程序脚本,我看到了很多关于实用程序和数学类的参考资料。如何将这些类添加到脚本中。当我尝试引用方法时,会出现一个错误 我尝试过的代码: function myTest() { var name = (new Date()).toLocaleDateString(); var ss = SpreadsheetApp.getActiveSpreadsheet(); var sht_0 = ss.getActiveSheet(); va

我正在学习谷歌应用程序的应用程序脚本,我看到了很多关于实用程序和数学类的参考资料。如何将这些类添加到脚本中。当我尝试引用方法时,会出现一个错误

我尝试过的代码:

function myTest() { 
    var name = (new Date()).toLocaleDateString(); 
    var ss = SpreadsheetApp.getActiveSpreadsheet(); 
    var sht_0 = ss.getActiveSheet(); 
    var sht_1 = ss.insertSheet(name); 
    SpreadsheetApp.setActiveSheet(sht_0); 
    utilities.sleep(10000); 
    var rng = sht_0.setActiveRange('A1:A5'); 
    sht_0.setActiveRange(rng); 
}
我得到的错误是:

ReferenceError:未定义“实用程序”。(第7行,文件“代码”)

谢谢
伊恩

请向我们提供您尝试的代码和错误,以便我们能更准确地帮助您。这是我的代码……”函数myTest(){var name=(new Date()).toLocaleDateString();var ss=SpreadsheetApp.getActiveSpreadsheet();var sht_0=ss.getActiveSheet();var sht_1=ss.insertSheet(name);SpreadsheetApp.setActiveSheet(sht_0);utilities.sleep(10000);var rng=sht_0.setActiveRange('A1:A5');sht_0.setActiveRange(rng)}“错误是。。。ReferenceError:未定义“实用程序”。(第7行,文件“代码”)如何更好地格式化代码?实用程序采用大写首字母。使用自动完成功能可以避免这些问题(控件+空间)。与许多语言一样,大小写也很重要