DocsServiceApp was updated to v1.2.2 v1.2.2 (January 30, 2024)
Remove a bug in ExcelApp. When the inserted image had no data, an error occurred. This issue was removed. You can see the detail information here https://github.com/tanaikech/DocsServiceApp
Gists
Description When the generated text can be automatically inserted into the cursor position of Google Document, Google Spreadsheet, and Google Slide, it will be useful for users. This report introduces sample scripts for achieving this.
Sample scripts Here, I would like to introduce 3 sample scripts for a Google Document, a Google Spreadsheet, and a Google Slide.
Create an API key These sample scripts request Gemini Pro API using an API key.
Gists
Abstract This report introduces the method for retrieving the Emoji reactions from the comments in Google Docs files (Google Documents, Google Slides, and Google Spreadsheets) using Google Apps Script.
Introduction Recently, the Emoji reactions have been implemented in the comments on Google Docs files (Google Documents, Google Slides, and Google Spreadsheets). Ref With this implementation, the collaborative work has been higher. Here, it is considered that when the Emoji reactions can be retrieved from the Google Docs files, the statistics of the reactions will be also more useful for increasing collaboration.
Gists
This is a sample script for managing the row height and the column width of a table on Google Slides using Google Apps Script.
In the current stage, Google Slides service (SlidesApp) cannot manage the row height and the column width of the table on Google Slides, while the table width and height can be managed. But, fortunately, when Google Slides API is used, this can be achieved.
In this post, I would like to introduce a sample script for managing the row height and the column width of a table on Google Slides using Google Apps Script.
Gists
Introduction This is a simple workaround for starting an animation GIF on Google Slide by clicking.
When an animation GIF is inserted into a slide of Google Slides, the animation is automatically started. By this, the timing for starting cannot be controlled by the user side. In this post, I would like to introduce a workaround for resolving this issue. Preparation The sample flow is as follows.
Prepare a sample animation GIF.
Overview This is a Google Apps Script library for supporting Document service, Docs API, Spreadsheet service, Sheets API, Slides service and Slides API. The aim of this library is to compensate the processes that they services cannot achieve.
DocsServiceApp was updated to v1.2.0 v1.2.0 (September 29, 2022)
Added a new method of getNamedFunctions(). This method can retrieve the named functions from Google Spreadsheet. You can see the detail information here https://github.
Overview This is a Google Apps Script library for supporting Document service, Docs API, Spreadsheet service, Sheets API, Slides service and Slides API. The aim of this library is to compensate the processes that they services cannot achieve.
DocsServiceApp was updated to v1.1.0 v1.1.0 (September 28, 2022)
Added a new method of getQuotePrefixCells(). This method can detect the cells with the quote prefix cells. You can see the detail information here https://github.
Gists
This is a sample script for inverting the selected objects on Google Slides using Google Apps Script.
I have the case that I want to invert the selected objects on Google Slides. This sample script can be achieved this goal using Google Apps Script.
Sample script Please copy and paste the following script to the script editor of Google Slides, and save the script. And, please select the objects on the Slide and run the function main().
Gists
This is a sample script for exporting all thumbnail images retrieved from Google Slides as a zip file using Google Apps Script.
Sample script Before you use this script, please enable Slides API at Advanced Google services. Ref
function myFunction() { const presentationId = "###"; // Please set Google Slides ID. const folderId = "###"; // Please set the folder ID. const outputFilename = "###"; // Please set the output filename.
Gists
This is a sample script for reducing the table height of the table inserted from Google Spreadsheet to Google Slides using Google Apps Script.
Sample script Please copy and paste the following script to the script editor of Google Slides. This sample script uses Slides API. So, please enable Slides API at Advanced Google services. Ref
As the sample situation, this script supposes that a table is manually copied from Google Spreadsheet to the 1st slide of Google Slides.
Gists
This is a sample script for simply editing the texts of texts boxes on Google Slides using Google Apps Script. The supposed situation is as follows.
Google Slides has several text boxes of the same size and the same position. You want to retrieve the list of texts from the text boxes and want to change the texts using a simpler method. In this case, I thought that when the sidebar created by Google Apps Script is used for changing the texts, your goal might be able to be simply achieved.
Overview This is a sample script for achieving a simple photo gallery created by Google Slides and Web Apps using Google Apps Script.
Description At Google, there is a great Google Photos. Ref Recently, I was required to have a simple photo gallery. At that time, I thought that when an independence photo gallery instead of Google Photos can be used, it will be useful. Also, this might be useful for other users.
Gists
This is a sample script for creating the custom grid view of Google Slides as an image using Google Apps Script.
Demo Usage In order to use this script, please do the following flow.
1. Install GAS library This sample script uses a library of DocsServiceApp. So please install DocsServiceApp. You can see the method for installing it at here.
2. Enable APIs This sample script uses 2 APIs of Drive API and Slides API.
Gists
This is a sample script for adding the slide page link to the shape using Google Apps Script.
When I use Google Slides, there is the case that I want to jump to the specific slide on the same Google Slides. And, I have the case that I want to jump from the last slide to the 1st slide. In those cases, I had manually added the slide page link to each shape.
Overview This is a Google Apps Script library for supporting Document service, Docs API, Spreadsheet service, Sheets API, Slides service and Slides API. The aim of this library is to compensate the processes that they services cannot achieve.
Description The Google services, which are Document service, Docs API, Spreadsheet service, Sheets API, Slides service and Slides API, are growing now. But, unfortunately, there are still the processes that they cannot done.
Gists
This is a sample script for decoding a QR code put in Google Slides using Google Apps Script. In this case, Javascript is used at the opened dialog. And Canvas API and jsQR are used. So unfortunately, this method cannot be used with the time-driven trigger and the Google Apps Script project of the standalone type.
Of course, this method can be also used for Google Document and Google Spreadsheet.
Gists
This is a sample script for cropping images in the Google Slides using Google Apps Script. In the current stage, in order to crop the images in Google Slides, it is required to use replace(blobSource, crop) Because, although there is the “cropProperties” of “UpdateImagePropertiesRequest” in Slides API, unfortunately, in the current stage, this cannot be still used. This has already been reported. Ref
About cropping using replace(blobSource, crop), I thought that how to use might be a bit difficult.
Gists
This is a sample script for managing the texts on Google Slides using Google Apps Script. Recently, I got the request like this. I published this here, because I thought that this might be also useful for other users.
Demo In this demonstration, the text of {{baz}} on Google Slides are searched and replaced to other text, and also, the text style is changed.
Sample situation In this case, it supposes that there are 3 types of shapes in the slide.
Gists
In this sample script, all pages in the Figma file are retrieved and the retrieved pages are put to new Google Slides as the image.
Usage 1. Retrieve access token You can see the method for retrieving the access token at here. Although there is also OAuth2 for retrieving the access token, in your situation, I thought that the method for directly generating the access token on the site might be suitable.
Gists
When an image is inserted to Google Docs (Spreadsheet, Document and Slides) using the method of insertImage using Google Apps Script, there is the case that the error occurs. The error messages are “server error” and “invalid image data”. Here, I would like to introduce the limitations for inserting images to Google Docs. As the result, it was found that the limitation is due to both the mimeTypes and the area of image rather than the file size.
Gists
This is a sample script for summarizing Slides as thumbnails. For example, it supposes a Slides including 15 pages. When this script is run, it summarizes 6 pages to one page as images. I created this because there are no methods for directly achieving this. This is useful for myself. If this is also useful for you, I’m glad.
The flow of this workaround is as follows.
Flow: Copy the original Slides file as a temporary file.
Overview ArrangeStackingOrder is a GAS library for arranging the stacking order of page elements on Google Slides using Google Apps Script (GAS).
Demo This is a demonstration of this library when this is used as a Google Slides Addon.
Description Do you have situations that you want to arrange the stacking order of page elements on Google Slides using GAS? I had it before. At that time, I could achieve it by creating a simple script.
At February 15th, 2018, ShapeApp was featured as one of “4 useful add-ons launched last month”.
ShapeApp for Google Slides was published as an add-on application When you use Google Slides, have you ever thought about creating and updating shapes on Slides by inputting parameters, and arranging selected shapes? I have thought about them. Recently, since Class SlidesApp was added to GAS, it came to be able to easily to create various applications for Slides. So I created this. This application is add-on application which was made of GAS.
I have reported because I found a bug for scopes of Slides. The detail is the following URL.
https://issuetracker.google.com/issues/71448583
Gists
This is a document for explaining the difference between given values and retrieved values for shapes on Google Slides. When a shape is created to a slide using Slides API, most users give the size of height and width as pt. When the size is retrieved from the created shape as pt, the size is often difference from the given size.
For example, when a square shape is created by giving the height and width of 100 pt, the size which is retrieved from the created square becomes 99.
Gists
This sample script is for retrieving the size (width and height) of a table in Google Slides using Google Apps Script.
There are no methods for directly retrieving the table size using SlidesApp yet. So I thought of a workaround using Slides API.
When the slide information is retrieved using Slides.Presentations.Pages.get() of Slides API, the information of tables is also included. In the information, the height and width of table are also included.
Gists
By recent Google updated, Class SlideApp is added to Google Slides. SlideApp will be bring a lot of applications. Here, I would like to introduce 2 samples.
1. Sidebar function showSidebar() { var html = HtmlService .createHtmlOutput('Hello, world! <input type="button" value="Close" onclick="google.script.host.close()" />') .setTitle('My custom sidebar') .setWidth(300); SlidesApp.getUi().showSidebar(html); } 2. Copy slides in existing Slide to a new Slide This sample script create a new Slide with slides you want to copy.