I have a Google DOC. The DOC has embedded Google Diagrams. I'm writing a Google Script to transfer the content of the Document to a Sheet. The script goes through the document "body's children" identifying if it is a Paragraph or Table, and if it is a paragraph, extract the Text, In line drawing, or In line image.
Now, in DOCS a Diagram is represented as an image of the Diagram, not the diagram per se. Google Docs executes a request (e.g. https://docs.google.com/a/mydomain.com/drawings/d/sDanx1eRvHChcrvgj1IIdCQ/image?w=719&h=573&rev=1346&ac=1) that generates an image (terrible resolution by the way, but that a different topic). Such image is stored "somewhere" as a persistent file, and incorporated into the document via another request (e.g. filesystem:https://docs.google.com/persistent/docs/documents/1DlxAjdWZAVOkGvq1CZvsbEpxBNs8bDCPW1972UKfbxU/drawing/sDanx1eRvHChcrvgj1IIdCQ?zx=xxuxts66tny4). Neither are regular straight-forward URLs to an image.
The '=IMAGE' function and other Google "dialog screens" (like Insert image from URL in Docs) will NOT resolve them. The preference to use '=IMAGE' is that the image remains with the cell.
Furthermore, the INLINE IMAGE type appears not to provide a method to even acquire these URLs, or the Diagram's document ID. Even if I could get the URLs, using the URLs directly or 'fetching' them to create a Blob from them, I only see they would be useful with the InsertImage method, which would leave the image detached from a cell.
Apparently, even using the URL that generates the Image with the insertImage(blob), fails saying there was a server error.
Any ideas?