Fixing and Improving the removeBlankLines Function in Google Apps Script

In this blog post, we will explore how to fix and improve a function written in Google Apps Script that removes blank lines from a Google Docs document. This can be particularly useful for cleaning up documents with unnecessary blank lines. Original Function Here is the original removeBlankLines function: function removeBlankLines(docId) { try { var … Read more

Free First Chapters Google Apps Script Playground: Explore Coding with 120 Interactive Exercises for All Skill Levels

📢 FREE Kindle Promotion Alert! Get your copy of “Coding with Google Apps Script: A Step-by-Step Journey” absolutely FREE until May 22, 2024! US https://www.amazon.com/dp/B0D3TZXG39 CAN https://www.amazon.ca/dp/B0D3TZXG39 “Coding with Google Apps Script: A Step-by-Step Journey”, authored by Laurence Lars Svekis, serves as a comprehensive guide for anyone keen on mastering Google Apps Script (GAS) through … Read more

How to Manage Google Drive Folders with Google Apps Script

How to Manage Google Drive Folders with Google Apps Script Managing folders efficiently in Google Drive using Google Apps Script is an essential skill for anyone looking to automate their file organization and management tasks. In this blog post, we’ll walk through a step-by-step process to check if folders exist and how to create them … Read more

Output Calendar Events into Web App

Step 1: Enable the Google Calendar API Step 2: Set Up Google Apps Script Project Step 3: Write the Server-side Code to Fetch Events Here’s a basic script to fetch calendar events for the current month: function getCalendarEvents() { var calendarId = ‘primary’; // Use ‘primary’ for the primary calendar var now = new Date(); … Read more

Automating Invoice Creation and Distribution Using Google Apps Script

For many small businesses, the process of creating invoices is both vital and time-consuming. Automating this process can save time, reduce errors, and ensure that payments are requested promptly. This blog post will guide you through setting up an automated system that creates invoices in Google Docs from sales data in a Google Sheet and … Read more

Getting a file as a blob from Google Drive

Getting a file as a blob from Google Drive can be accomplished using the Google Drive API provided by the DriveApp service. Here’s a step-by-step guide on how to retrieve a file by its ID and get it as a blob, which you can then use for various operations such as copying, modifying, or sending … Read more

Schedule and Track Social Media Posts in Google Sheets

Schedule and Track Social Media Posts in Google Sheets Post Title Scheduled Date Status Launch Announcement 2024-05-08 Feature Update 2024-05-08 Posted Customer Story 2024-05-09 Objective: Use a script to schedule social media posts stored in Google Sheets and mark them as posted on scheduled dates. Steps: Set up a Google Sheet with columns for Post … Read more

Automate Responses to Google Forms Submissions

To set up a trigger for the function onFormSubmit(e) which automatically sends an email to a user after they submit a form, you’ll first need to write the function as part of a Google Apps Script project linked to your Google Form or Sheet. Then, you’ll create a trigger that fires every time the form … Read more

Sync Contacts from Spreadsheet to Google Contacts

Objective: Write a script to add contacts from a Google Sheet into Google Contacts, checking for duplicates to avoid redundant entries. Steps: Ensure your Google Sheet includes columns for First Name, Last Name, and Email. Open Extensions > Apps Script. Replace the existing code with: function syncContacts() {  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();  const data = … Read more

Automating Document Creation with Google Apps Script

Efficiency is key in any business setting, and automation can play a pivotal role in streamlining repetitive tasks. One common administrative task is the generation of documents for records or communications based on data collected in spreadsheets. In this blog post, we will discuss how to use Google Apps Script to automatically generate Google Docs … Read more