初心者からこの基本的な質問をお許しください。私はこのエラーコードをGoogle Appsスクリプトで私に送ってきました。子のインデックス(1)は子要素の数より小さくする必要があります
子のインデックス(1)は子要素の数(0)より小さくする必要があります。 (行86、ファイル "コード")私はいくつかのコードを変更して以来。
コードの86行目はありません。また、私が実行したテストでは、以下のコード行が問題になることが示唆されています。
ありがとうございます!
function getImageLinks(){
//create array of images to update (paragraph, index, URL, width, height)
var imgLocations = [
[78,1,'https://docs.google.com/spreadsheets/EDITED OUTimage',680,393],
// var doc = DocumentApp.openById('1NENe-GSyUDNLHwp84cKwamDlQbbIipaZ2i2GGFUOFr0'); //test
var doc = DocumentApp.openById('1mwwJBPdGPAdILZ9pfARqTAG5Gt9svPthqZ8RcCRS6xI'); //prod
var body = doc.getBody();
for(var intX=0;intX<imgLocations.length;intX++){
var newImage = UrlFetchApp.fetch(imgLocations[intX][2]);
var img = body.getChild(imgLocations[intX][0]).asParagraph().getChild(imgLocations[intX][1]);
var parent = img.getParent();
var paragraph = parent.asParagraph();
img.removeFromParent();
paragraph.insertInlineImage(imgLocations[intX][1],newImage);
**var updatedImage = body.getChild(imgLocations[intX][**0]).asParagraph().getChild(imgLocations[intX][1]);
updatedImage.asInlineImage().setWidth(imgLocations[intX][3]).setHeight(imgLocations[intX][4]);
}
}
大括弧: '' [[...] '' ' –
コードを切り捨てましたか? imgLocationsには閉じ括弧がなく、最後のエントリがありません。 –