My script at https://github.com/berteh/SheetsToDocsMerge/blob/master/merge.gs is inserted in a google spreadsheet to use it as a "mail-merge" source that duplicates a google document (template given by its ID) and substitutes some placeholders between brackets "[variable-name]" with the corresponding cell content of the spreadsheet.
I want to be able to include images dynamically into the resulting document as weel. Providing either the URL of the image in the spreadsheet, or the image itself (using the =IMAGE(URL)), but find no way to
- detect if source cell content is an image and
- generate content in the output document that will result in the image being included.
Any idea how to do so? thanks! Berteh.