Skip to content

Instantly share code, notes, and snippets.

View tanaikech's full-sized avatar

Kanshi TANAIKE tanaikech

View GitHub Profile
@tanaikech
tanaikech / submit.md
Last active July 12, 2024 00:27
Uploading Large Files to Gemini with Google Apps Script: Overcoming 50 MB Limit

Uploading Large Files to Gemini with Google Apps Script: Overcoming 50 MB Limit

Abstract

Uploads in Google Apps Script are limited to 50 MB, hindering work with large datasets. This report introduces a script with uploadType=resumable to overcome this limit, enabling uploads over 50 MB to Gemini and other services.

Introduction

@tanaikech
tanaikech / submit.md
Last active June 24, 2024 05:05
Analyzing Folder Structures with Google Apps Script

Analyzing Folder Structures with Google Apps Script

Abstract

This report provides a Google Apps Script to retrieve all files, including those within subfolders, for a designated folder. It addresses the challenges of retrieving files within deeply nested folder structures and obtaining complete file paths.

Introduction

Google Apps Script empowers developers to interact with Google Drive data programmatically, unlocking a wide range of functionalities. A core component of this interaction is the Drive service (DriveApp) and Drive API. These services provide programmatic control over files and folders within your Drive.

@tanaikech
tanaikech / submit.md
Last active June 15, 2024 07:27
Unlock Smart Invoice Management: Gemini, Gmail, and Google Apps Script Integration

Unlock Smart Invoice Management: Gemini, Gmail, and Google Apps Script Integration

You can see the presentation of this application at https://www.youtube.com/watch?v=Dc2WPQkovZE.

Abstract

This report describes an invoice processing application built with Google Apps Script. It leverages Gemini, a large language model, to automatically parse invoices received as email attachments and automates the process using time-driven triggers.

@tanaikech
tanaikech / submit.md
Last active June 12, 2024 06:57
Move Folder including Files and Folders in Google Drive using Google Apps Script

Move Folder including Files and Folders in Google Drive using Google Apps Script

Abstract

This script automates moving a folder including files and folders between Google Drives (personal or shared) by recreating the folder structure and transferring files, overcoming limitations for shared drives.

Introduction

@tanaikech
tanaikech / submit.md
Created June 2, 2024 06:48
Expanding Error Messages for Google Apps Script with Gemini 1.5 Flash

Expanding Error Messages for Google Apps Script with Gemini 1.5 Flash

Abstract

This report builds on prior work using Gemini 1.0 Pro to expand Google Apps Script error messages. It highlights how the script's execution time limit created a bottleneck, but the introduction of Gemini 1.5 Flash eliminates this issue.

Introduction

@tanaikech
tanaikech / submit.md
Created May 28, 2024 08:14
Techniques for Creating Nested Lists on Google Documents using Google Docs API

Techniques for Creating Nested Lists on Google Documents using Google Docs API

Abstract

Current Google Docs API documentation offers methods for working with existing lists but lacks instructions for creating nested lists in new documents. This report fills this gap, empowering developers and streamlining nested list creation using Google Apps Script (concepts applicable to other languages).

Introduction

The official Google Docs API documentation provides instructions for working with existing lists, including converting paragraphs to lists and removing bullets. However, it lacks guidance on creating nested lists within an empty document body. Ref

@tanaikech
tanaikech / submit.md
Last active May 27, 2024 01:41
Enhancing HTML and Javascript Development in Script Editor of Google Apps Script: Overcoming Formatting Challenges

Enhancing HTML and Javascript Development in Script Editor of Google Apps Script: Overcoming Formatting Challenges

Abstract

Despite the improved Google Apps Script IDE launched in April 2022, challenges arise for HTML and Javascript development. The Script Editor's built-in formatting for these languages proves insufficient, particularly for large Javascript codebases, potentially causing errors. This report proposes a solution to address this formatting issue and streamline development within the Script Editor.

Introduction

@tanaikech
tanaikech / submit.md
Created May 21, 2024 06:59
Taming the Wild Output: Effective Control of Gemini API Response Formats with response_schema

Taming the Wild Output: Effective Control of Gemini API Response Formats with response_schema

Abstract

The Gemini API traditionally required specific prompts for desired output formats. This report explores two new GenerationConfig properties: "response_mime_type" and "response_schema". These allow developers to directly specify formats like JSON, enhancing control and predictability. We analyze and compare the effectiveness of both properties for controlling Gemini API output formats.

Introduction

@tanaikech
tanaikech / submit.md
Created May 16, 2024 02:03
Checking API Enabled with Advanced Google Services using Google Apps Script

Checking API Enabled with Advanced Google Services using Google Apps Script

Overview

This script checks if the desired API is enabled or disabled in the Advanced Google Services section of Google Apps Script.

Introduction

@tanaikech
tanaikech / submit.md
Created May 15, 2024 00:20
Adding Page Numbers to PDF using Google Apps Script

Adding Page Numbers to PDF using Google Apps Script

Description

This is a simple sample script for adding the page numbers to PDF data using Google Apps Script.

When you use this script, please copy and paste the following script to the script editor of Google Apps Script. And, please set the file ID of the PDF file.