tanaike

The Thinker

Exporting Google Docs Files in PDF format with Batch Requests using Google Apps Script

Gists This is a sample script for exporting Google Docs files (Spreadsheets, Documents, and so on) in PDF format with batch requests using Google Apps Script. I have published a report “Efficient File Management using Batch Requests with Google Apps Script”. In this report, I mentioned how to use the batch requests using Google Apps Script. In this post, I would like to introduce the method for retrieving binary data using this method.

Updated: GAS Library - BatchRequest

BatchRequest was updated to v1.2.1. v1.2.1 (March 8, 2023) An option of exportDataAsBlob was added to the request object to the method of EDo(). Ref When this option is used, the response values from the batch requests are returned as Blob. By this, for example, when you export Google Spreadsheet as PDF data using the batch requests, the PDF data can be retrieved as Blob. Sample script using exportDataAsBlob In this sample, the Spreadsheet and Document files are exported as PDF format using the batch requests.

Resumable Download of File from Google Drive using Drive API with Python

Gists This is a sample script for achieving the resumable download of a file from Google Drive using Dive API with Python. There might be a case in that you want to achieve the resumable download of a file from Google Drive using Dive API with Python. For example, when a large file is downloaded, the downloading might be stopped in the middle of downloading. At that time, you might want to resume the download.

Retrieving Total File Sizes in Specific Folder of Google Drive using Google Apps Script

Gists This is a sample script for retrieving the total file sizes in the specific folder of Google Drive using Google Apps Script. There is a case where you want to retrieve the total file sizes in the specific folder of Google Drive using Google Apps Script. In this post, I would like to introduce a sample script for achieving this. Sample script Before you use this script, please enable Drive API at Advanced Google services.

Retrieving Start and End Row Numbers of Same Values in a Column on Google Spreadsheet using Google Apps Script

Gists This is a sample script for retrieving the start and end row numbers of the same values in a column on Google Spreadsheet using Google Apps Script. There is a case in that I want to retrieve the rows of the same values in a column on Google Spreadsheet using Google Apps Script. In this post, I would like to introduce a simple sample script for achieving this. Sample script function myFunction() { const sheet = SpreadsheetApp.