From the course: Google Apps Script for JavaScript Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Finding images

Finding images - Google Docs Tutorial

From the course: Google Apps Script for JavaScript Developers

Start my 1-month free trial

Finding images

- [Instructor] At this point, we've now been able to format a lot of the text for our markdown output. Let's take a look at how we can manage images so that we know, one, where to put them, and two, how to save them later on. We'll go back into our convert to markdown project, and go to out doc to markdown script. Let's scroll up to our parse element function. As we go through the document and capture images, we're going to want to keep track of each of the image's numbers as well as a way of collecting the images into a single array, so that we can reference them later and save them to Google Drive. We'll start by modifying our parse element method. Let's an add an image counter and we'll add an images array. Next we can scroll down to where we identify that an element type is an in-line image. Before we set the text to image, let's go ahead and increment the image counter by one. Next we're going to need to get a reference to the image itself. We're going to create a new variable…

Contents