How to Resize All Images in Google Docs to 50% Page Width (Using Apps Script)

https://github.com/lsvekis/Apps-Script-Code-Snippets If you’ve ever worked on a long Google Doc with lots of images, you know the pain:some images are too large, some too small, and manually resizing each one is tedious and inconsistent. The good news? Google Apps Script can handle this automatically. In this post, you’ll learn how to use a simple Apps … Read more

AI Report Generator for Google Docs Apps Script and Gemini 9

https://github.com/lsvekis/Apps-Script-Code-Snippets/tree/main/apps_script_gemini_ai_report_generator_docs 🚀 Apps Script + Gemini Mastery — Issue #9 AI Report Generator for Google Docs Turn Google Sheets data into polished executive reports automatically using Apps Script + Gemini. ⭐ What You Will Build in This Issue In this lesson, readers will build an AI Report Generator that: 📊 Reads structured data from Google … Read more

Google Apps Script – 100 Question Quiz

✅ Google Apps Script – 100 Question Quiz With Detailed Answers & Explanations 🟢 SECTION 1: Google Apps Script Fundamentals (1–20) 1. What is Google Apps Script? Answer:Google Apps Script is a cloud-based JavaScript platform used to automate, extend, and integrate Google Workspace apps. Explanation:It runs on Google’s servers and allows you to write JavaScript … Read more

AI Data Cleaner for Google Sheets Google Apps Script and Gemini

🚀 Apps Script + Gemini Mastery — Issue #8 https://github.com/lsvekis/Apps-Script-Code-Snippets/tree/main/apps_script_gemini_ai_data_cleaner_sheets AI Data Cleaner for Google Sheets Automatically clean, normalize, and prepare messy spreadsheet data using Gemini + Apps Script. ⭐ What You Will Build in This Issue In this lesson, you’ll build an AI-powered data cleaning assistant for Google Sheets that can: 🧹 Detect messy … Read more

Instantly Create a Clickable Table of Contents in Google Docs with Apps Script

If you work with long Google Docs—guides, reports, lesson plans, ebooks, or AI-generated drafts—navigation quickly becomes painful. Headings exist… but readers still scroll endlessly. In this post, we’ll build a smart Apps Script that: ✅ Scans all headings in a document✅ Automatically generates a clickable Table of Contents✅ Inserts it at the top of the … Read more

100 Advanced Google Apps Script Examples

https://github.com/lsvekis/100-Advanced-Google-Apps-Script-Examples A) Sheets: Performance, Data Ops, Automation (1–25) 1) Batch update with RangeList (fast formatting) Does: Applies formatting to many ranges in one go. 2) Write values + formulas in one pass Does: Sets values and formulas efficiently. 3) Build an index of unique keys → row numbers Does: Creates a lookup map for fast … Read more

Google Apps Script 50 Exercises Explained Vol 2

1) Custom menu in Google Sheets Does: Adds a menu item so users can click to run functions.How it works: onOpen() runs automatically when the file opens (for editors), and SpreadsheetApp.getUi() adds UI. function onOpen() {   SpreadsheetApp.getUi()     .createMenu(‘Tools’)     .addItem(‘Say Hello’, ‘sayHello’)     .addToUi(); } function sayHello() {   SpreadsheetApp.getUi().alert(‘Hello from Apps Script!’); } 2) Show a toast … Read more

Google Apps Script 50 Exercises Explained Vol 1

https://github.com/lsvekis/Apps-Script-Code-Examples 1) Add a Custom Menu on Open (Sheets) Does: Adds a menu to your spreadsheet UI.Use when: You want easy buttons for scripts. function onOpen() {   SpreadsheetApp.getUi()     .createMenu(‘Tools’)     .addItem(‘Say Hello’, ‘sayHello’)     .addSeparator()     .addItem(‘Run Cleanup’, ‘cleanup’)     .addToUi(); } function sayHello() {   SpreadsheetApp.getUi().alert(‘Hello from Apps Script!’); } function cleanup() {   SpreadsheetApp.getUi().alert(‘Cleanup placeholder.’); } 2) Show a … Read more

Docs Service vs Apps Script Why it works

Why Google Apps Script Couldn’t Convert My H2 Headings (and the Fix That Actually Works) If you’ve ever tried to programmatically convert Heading 2 → Heading 3 in Google Docs using Apps Script, you probably expected something simple like: And yet… nothing happened.Or worse: Exception: Unexpected error while getting the method or property setHeading on … Read more

How to Chunk Google Apps Script Code to Avoid Exceeded Maximum Execution Time

https://github.com/lsvekis/Apps-Script-Code-Snippets/tree/main/google-apps-script-chunking-pattern If you’ve ever run a Google Apps Script and hit this dreaded error: Exceeded maximum execution time —you’re not alone. This happens a lot when working with Google Docs, Sheets, Drive, or Gmail, especially when looping through large documents, spreadsheets, or folders. The good news?You don’t need to rewrite everything or give up on … Read more