先谢谢你。
这里只是一些样本,你可以从官方文档中获得很多有用的信息。
文档。https:/developers.google.comapps-scriptguideshtml。
/**
* code.gs
*/
function doGet(){
return HtmlService.createHtmlOutputFromFile('HTML file name');
}
文件。https:/developers.google.comapps-scriptadvanceddrive#uploading_files。
正式的例子。
/**
* code.gs
* Uploads a new file to the user's Drive.
*/
function uploadFile() {
var image = UrlFetchApp.fetch('url').getBlob();
var file = {
title: 'google_logo.png',
mimeType: 'image/png'
};
file = Drive.Files.insert(file, image);
Logger.log('ID: %s, File size (bytes): %s', file.id, file.fileSize);
}
文档。https:/developers.google.comapps-scriptreferencespreadsheet。
/**
* code.gs
*/
var SpreadSheet = SpreadsheetApp.openByUrl(url);
var SheetName = SpreadSheet.getSheetByName(users);
var lastColumn = SheetName.getLastColumn();
var lastRow = SheetName.getLastRow();
/**
* code.gs
*/
var SpreadSheet = SpreadsheetApp.openByUrl(url);
var SheetName = SpreadSheet.getSheetByName(users);
var range = SheetName.getRange(1, 5, 1, 1);
range.setValues([["Write Data"]]);