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
Google apps script 获取文件详细信息并将图像加载到电子表格中_Google Apps Script_Google Sheets - Fatal编程技术网

Google apps script 获取文件详细信息并将图像加载到电子表格中

Google apps script 获取文件详细信息并将图像加载到电子表格中,google-apps-script,google-sheets,Google Apps Script,Google Sheets,我有一个例行程序,打印文件夹中的所有文件,该文件夹包含图像文件,它们是图标。脚本获得了各种详细信息,如文件名、上次更新等。我想在结果中添加一列,显示实际图标。我怎样才能做到这一点。你可以使用这种方法 样本: function myFunction() { var sheet = SpreadsheetApp.getActive().getActiveSheet(); var file = DriveApp.getFileById("XXXX"); var blobSource = f

我有一个例行程序,打印文件夹中的所有文件,该文件夹包含图像文件,它们是图标。脚本获得了各种详细信息,如文件名、上次更新等。我想在结果中添加一列,显示实际图标。我怎样才能做到这一点。

你可以使用这种方法 样本:

function myFunction() {
  var sheet = SpreadsheetApp.getActive().getActiveSheet();
  var file = DriveApp.getFileById("XXXX");
  var blobSource = file.getBlob();
  var column = 1;
  var row = 1;
  sheet.insertImage(blobSource, column, row)
}

你试过图像功能吗?在哪里打印?进入电子表格?是否要将实际图标插入电子表格?是的,因此工作表中每个文件都有一个具有各种属性的角色以及一个包含图标的单元格