Image duplicates itself when using appendParagraph in Google Script
问题 I wrote a script to add an image from my Google Drive and some custom text to a Google Doc. (I got the image insertion code from here). The resulting document is created ok, but my image is added twice for some reason ... function myFunction(e) { var doc = DocumentApp.create('fileTest'); var body = doc.getBody(); var matchedFiles = DriveApp.getFilesByName('logo.png'); if (matchedFiles.hasNext()) { var image = matchedFiles.next().getBlob(); var positionedImage = body.getParagraphs()[0]