Google Apps Script project for automating formatting in Google Docs

Features: function resetHeadingSizes() { var doc = DocumentApp.getActiveDocument(); var body = doc.getBody(); var paragraphs = body.getParagraphs(); // Define default font sizes for headings var headingSizes = { [DocumentApp.ParagraphHeading.HEADING1]: 24, [DocumentApp.ParagraphHeading.HEADING2]: 20, [DocumentApp.ParagraphHeading.HEADING3]: 18, [DocumentApp.ParagraphHeading.HEADING4]: 16, [DocumentApp.ParagraphHeading.HEADING5]: 14, [DocumentApp.ParagraphHeading.HEADING6]: 12 }; // Iterate through paragraphs and reset heading sizes paragraphs.forEach(paragraph => { var heading = paragraph.getHeading(); … Read more

Google Apps Script that converts all Heading 3 styles to Heading 2 in a Google Docs document

Here’s a Google Apps Script that converts all Heading 3 (H3) styles to Heading 2 (H2) in a Google Docs document. It loops through all the paragraphs and updates the heading styles accordingly. Steps to Use: Apps Script: function convertH3toH2() { var doc = DocumentApp.getActiveDocument(); var body = doc.getBody(); var paragraphs = body.getParagraphs(); for (var … Read more

Automation of numbering Heading 2 titles using Google Apps Script in Google Docs

Here’s a Google Apps Script that scans a Google Doc, finds all Heading 2 paragraphs, and adds sequential numbering before each heading. Apps Script Code function numberHeading2InDoc() { var doc = DocumentApp.getActiveDocument(); var body = doc.getBody(); var paragraphs = body.getParagraphs(); var count = 1; // Start numbering from 1 for (var i = 0; i … Read more

Automate Google Docs: Remove Numbering from Heading 2 Using Apps Script

If you work with structured documents, you may encounter headings that are automatically numbered, such as: 📌 “207. Create a Dynamic Weather Widget” However, in many cases, you might want to remove the numbering while keeping the actual heading text intact. Instead of manually editing each heading, you can automate the process using Google Apps … Read more

Automate Google Docs: Convert H3 Headings to Bold Text Using Apps Script

Google Docs provides an easy way to format text using different heading styles. However, if you ever find yourself needing to convert all Heading 3 (H3) text into bolded text while maintaining readability, you can automate the process using Google Apps Script. In this blog post, we’ll walk through a simple script that scans a … Read more

Remove Paragraph Indentations in Google Docs Using Apps Script

When working with Google Docs, formatting inconsistencies can sometimes cause unnecessary indentations, making your document look uneven or misaligned. If you frequently deal with documents where paragraphs have unwanted indentations, manually adjusting each one can be a time-consuming task. Luckily, Google Apps Script allows us to automate this process and remove all paragraph indentations with … Read more

Transforming Google Docs: Convert Bullet Points to Regular Paragraphs with Apps Script

Google Docs is a fantastic tool for creating and editing documents, but sometimes formatting can get in the way. Have you ever found yourself with a document full of bullet points that you’d rather see as regular paragraphs? Whether you’re cleaning up notes or preparing a more formal document, automating this conversion can save you … Read more

How to Add Custom Tabs in Google Docs Using Apps Script

Google Apps Script provides powerful automation features for Google Docs. One useful feature is inserting custom tabs within a document. In this blog post, we’ll create a script that adds two tabbed sections—“Advanced1” and “Advanced2”—allowing users to quickly navigate between them. What the Script Does ✅ Inserts two tabbed sections labeled “Advanced1” and “Advanced2”.✅ Allows … Read more

Enhancing Google Docs with Apps Script: Formatting Selected Text with Bold

Google Apps Script is a powerful tool for automating and enhancing Google Docs functionality. One common use case is modifying selected text dynamically, such as making it bold. In this blog post, we’ll explore a function that takes a user’s text selection in a Google Document and applies bold formatting while handling partial selections. Understanding … Read more