Apps Script that Cleans doc add spacing above each heading

This Google Apps Script demonstrates the power of automation in Google Workspace. Whether you’re managing files in Google Drive or cleaning up messy Google Docs, this script offers a simple yet effective solution. Here’s a Google Apps Script function that performs the following tasks on a Google Doc: Script: function formatDocumentSpacing() { const doc = … Read more

Streamline Your Workflow with Google Apps Script: Managing Files and Cleaning Docs Effortlessly

Google Apps Script is a powerful tool for automating tasks in Google Workspace. In this post, we’ll explore a script that integrates seamlessly with Google Sheets, helping you manage files in Google Drive and clean up Google Docs with ease. Features of the Script This script offers three main functionalities: How It Works 1. Adding … Read more

Google Apps Script that selects all files in a specified Google Drive folder and lists their details

Steps to Implement: Code: function listFilesInFolder() { const folderId = “YOUR_FOLDER_ID”; // Replace with your Folder ID const folder = DriveApp.getFolderById(folderId); const files = folder.getFiles(); const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); // Clear existing content in the sheet sheet.clear(); // Add headers sheet.appendRow([“File Name”, “File ID”, “File Path”]); while (files.hasNext()) { const file = files.next(); const fileName … Read more

Google Apps Script that will split your Google Doc into separate documents based on Heading 1

Below is a Google Apps Script that will split your Google Doc into separate documents based on Heading 1 (H1) tags, using the H1 text as the new document titles. The new documents will be saved in a folder within your Google Drive. Script Code: function splitDocByHeading() { var doc = DocumentApp.getActiveDocument(); var body = … Read more

Automate Formatting in Google Docs with Google Apps Script

If you’ve ever found yourself manually converting single-item lists into headings in Google Docs, you’ll appreciate how much time automation can save. With Google Apps Script, you can create a script to identify single-item lists with specific font sizes, remove their list formatting, and convert them into regular headings. This post introduces a powerful function, … Read more

Script to Bold Specific Words and Phrases in Google Docs

This script identifies specific words or phrases (e.g., Example:, Code Snippet:, Instructions:, Solution:) that constitute the entire paragraph or element in a Google Docs document and converts them to bold text. The Script function boldSpecificPhrases() { const doc = DocumentApp.getActiveDocument(); // Access the active Google Doc const body = doc.getBody(); // Get the document’s body … Read more

Automate Text Styling in Google Docs: Bold Questions with Google Apps Script

When working on documents such as quizzes, FAQs, or study guides, it’s common to have questions labeled with a specific format, like “Question 1”, “Question 2”, etc. Manually bolding these question labels can be tedious, especially in lengthy documents. But with Google Apps Script, you can automate this task effortlessly! In this post, we’ll create … Read more

Automatically Convert Example References to H3 Headings in Google Docs Using Apps Script

When working on structured documents, especially educational materials or guides, it’s common to have sections labeled with examples (e.g., Example 1:, Example 2:). Formatting these sections manually as headings can be time-consuming. With Google Apps Script, you can automate this task! In this blog post, we’ll create a script to identify all elements starting with … Read more

Automatically Format Numbered Elements as Headings in Google Docs Using Apps Script

Formatting documents in Google Docs can be tedious, especially when dealing with consistent patterns like numbered lists or structured data. If you’ve ever needed to transform all lines, start with a number and then add a period (e.g., 1., 2., etc.) into properly formatted headings, this blog post is for you. Using Google Apps Script, … Read more

Automate Line Removal in Google Docs with Google Apps Script

Managing text-heavy documents often requires tedious manual edits, especially when dealing with recurring unwanted lines. If you’ve repeatedly deleted lines starting with a specific phrase, it’s time to automate the process! With Google Apps Script, you can streamline this task in Google Docs and save valuable time. In this blog post, we’ll walk you through … Read more