Google Apps Script to create a custom function that cleans and formats text in a Google Docs document

Here’s a basic example that removes extra spaces and trims the text: To use this script: This script will clean the text by removing extra spaces and trimming leading and trailing spaces. You can modify the cleanText function to include other text cleaning operations as needed. Remember to save and run the script whenever you … Read more

Automating Document Formatting: Reset Font Sizes in Google Docs with Apps Script

Creating an Apps Script to reset font sizes to default for headings and paragraphs in a Google Doc involves iterating through the elements of the document and changing their font size based on their type. Below is a basic script that does this. Note that Google Docs does not have a single “default font size” … Read more

The Dual Edges of ChatGPT: Capabilities and Limitations

In the rapidly evolving landscape of artificial intelligence, ChatGPT stands out as a beacon of progress and a testament to the strides made in natural language processing (NLP). Developed by OpenAI, ChatGPT is a variant of the Generative Pre-trained Transformer models, fine-tuned for engaging in dialogue, generating text, and understanding complex user queries. This article … Read more

ChatGTP tips and examples Improve your experience

Here are 25 top tips for using ChatGPT effectively, designed to enhance your experience and ensure you get the most out of your interactions with the AI: By following these tips, you can improve your interactions with ChatGPT, making the experience more efficient, enjoyable, and tailored to your needs

100 Plus Google Apps Script Exercises Code Examples PDF guide more than 130 pages FREE

100+ Exercises  Google Apps Script Exercises Explore what you can do with Google Apps Script in Workspace.   Useful Code examples to get your started with Google Apps Script Log a Custom Message Purpose: Learn how to log a message in Apps Script. function logMessage() { Logger.log(‘Hello, Google Apps Script!’); } Explanation: This script uses the … Read more

How to remove multiple lines that contain text using Google Apps Script Doc clean up

provided code in detail. It consists of two functions: removeMultipleSpecificLines and removeBlankLines. These functions are designed to manipulate the content of a Google Docs document. removeMultipleSpecificLines() Explanation: removeBlankLines() Explanation: This function is similar to the previous one but is specifically designed to remove blank lines (paragraphs with no content) from the document. These two functions … Read more

How to remove whitespace in the front of page elements in Google Docs with Apps Script Easy Clean up

This code is a Google Apps Script that is designed to remove leading whitespace or blank space from text elements within a Google Docs document. Let’s break it down step by step: In summary, this script goes through all text elements in a Google Docs document’s body, removes leading whitespace from each element if it … Read more

Remove numbers at the start of a heading or any page element in Google Docs Google Apps Script Code

You can create a Google Apps Script to remove the first numbers up to the first period in Google Docs from all page elements if the element begins with a number. Here’s a sample script that you can use: Here’s how to use the script: The script will go through all the text elements in … Read more

Responding to User Input Interactive Drawing with HTML5 Canvas & JavaScript

Responding to User Input Draw a line on the canvas in response to user mouse movements code is below. canvas.addEventListener(‘mousemove’, function(event) {     const x = event.offsetX;     const y = event.offsetY;     ctx.lineTo(x, y);     ctx.stroke(); }); Explanation: An event listener for mousemove is added to the canvas. The offsetX and offsetY properties of the event provide the … Read more

Clearing the Canvas with JavaScript

To clear the entire canvas ctx.clearRect(0, 0, canvas.width, canvas.height); Explanation: clearRect(x, y, width, height) clears the specified rectangular area and sets it to transparent black.  To clear the entire canvas, you can use the clearRect() method of the canvas’s 2D rendering context. This method clears the specified rectangular area, making it fully transparent. To clear … Read more