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.

Saving images

Saving images - Google Docs Tutorial

From the course: Google Apps Script for JavaScript Developers

Start my 1-month free trial

Saving images

- [Instructor] So now that we're able to identify where images are, pull out their raw data, and replace our text with a path to the image, it's time for us to connect this up to the rest of our script logic. Let's start by going into the main script. Before we create the markdown text, let's go ahead and make a new variable called images, and we'll set this equal to an empty array. Next, we'll copy the reference to images, and next, we're going to supply this as an argument into our convert to markdown function call. Let's save this and go into our doc to markdown script, and scroll up to the top. Here, we'll need to supply this as an argument into the function, and at the top of this class, let's go ahead and create a new variable called image counter. And we're going to set this equal to zero. Next, we're going to want to pass a reference to the image counter and images array into our parse section function. Now we need to continue to pass these two variables all the way down into…

Contents