Hey there, code wranglers! 🤠 Welcome back to our Google Apps Script (GAS) UI series. Today, we’re venturing into the wild world of Single Page Applications (SPAs). For the uninitiated, a SPA is a web application that interacts with the user dynamically, rewriting the current web page with new data from the web server, instead of the default method of the browser loading entire new pages.📚
Now, why are SPAs a big deal? They help in reducing the time taken to load the entire page because only a part of the page gets updated. We’re going to bring this SPA magic to our sidebar with the help of a slick Navigo router. 🎩
No worries if ‘Navigo’ sounds like a hip new dance move. By now, you should be pretty comfy with installing dependencies from NPM. But if not, it’s like adding a shiny new tool to your utility belt. It just gives you the superpowers you need to build your web app.
Welcome Back to Mastering Google Apps Script UIs: Client-to-Server Communication Spotlight
Oh, howdy folks! Just like a boomerang, you’ve found your way back to our marvelous series. If you thought the previous episodes were fire, wait till you see what’s cooking today! 🔥
We’re diving headfirst into the world of client-to-server communication. It’s like passing notes in class, but with a lot less paper and a lot more code. 📝➡️💻
Here’s the catch though — we can’t install Google Apps Script locally to run things on our dev server. Yep, that’s right. It’s like trying to install a toaster in a bathtub; it just ain’t happening. 🛁🚫🍞
But fear not, dear coder, for I’ve got a trick or two up my sleeve. We’re gonna finesse our way around this with some snazzy hacks like promises, polyfills, and mocks. Oh my!
Well, well, well! Look who’s back for another session of “Weaving Magic with Code”! 😄 Today, we’re diving head-first into the magical world of unit testing. You might be wondering: “Why the fuss about unit testing?” 🤔
Unit testing, my friends, is the silent hero of software development. Picture it as a mini-pit stop where your code gets a once-over before it hits the road. The automated tests ensure that our code does exactly what we expect it to. The benefits?
Makes us ponder deeply about our app’s architecture, like a philosopher musing about the meaning of life 🧐
Forces us to clarify our expectations from functions and classes.
Ensures that as we revamp and update our code, we aren’t unknowingly playing host to bugs, much like a surprise party you didn’t want 🐛
Let’s take our UI to the next level with Tailwind CSS!
Introduction
In the previous article, we learned how to bundle NPM modules with Vite. Today, we’re going to add some style with Tailwind CSS. If you’ve been following my series, you’ll breeze through this like a true professional. 🚀
Check out the part-03 branch in the Github repository for the full source code.
What Is Tailwind CSS
Tailwind CSS is a utility-first CSS framework that makes styling a breeze. Think of it like a wardrobe filled with every piece of clothing that you’ll ever need, with everything neatly organized and ready to go. 💃🕺
Hey there, friends! 👋 Our Emojibar — yes, that’s what we’re calling it now — is coming along nicely! In the previous post, we learned how to bundle the project with Vite and vite-plugin-singlefile, and it’s now time to add some real functionality!
To complete our Emojibar, we’ll use two NPM modules:
Unicode-Emoji-JSON: We need a complete list of emojis, and this simple module provides them in JSON format. Perfect!
ToastifyJS: When users click on an emoji, it’ll be copied into their buffer. Just so they have some feedback, we’ll show them a confirmation toast. This library is great for this purpose.
We’ll also add search and navigation functionality, meaning that we’ll have the entire backbone of the application ready by the end of this post.
Sending out emails as a part of a Google Workspace automated workflow is a very common task. In Google Apps Script we can send emails to users using the MailApp.sendEmail(), the GmailApp.sendEmail() method or even as a JSON payload with the Gmail Advanced API service.
While one might expect that the sender’s signature block would also be transmitted with the automated email, we find that this is not in fact the case.
Scott Donald highlights some of the pitfalls of trying to access the Gmail signatures using Google Apps Script. Fortunately Scott also shares a workaround for using a Gmail draft to store a number of signatures/snippets. This is all wrapped in a handy getSignatureBlock() function, created and shared by Scott to get either the user’s primary signature block or one stored in a draft.
Last week, we talked about the best way to build front-ends for Google Apps Script. Today, let’s roll up our sleeves and dive in! 😎
As I mentioned in my previous post, we’re going to create a super cool sidebar in Google Sheets that’ll help us select emojis with ease. 😎 Google Docs already has this functionality natively: simply head over to the “Insert” menu, select “Emoji,” and voilà! You’ll see a neat dialogue window with all emojis organized by category, as well as a handy search function:
However, we want more, so, we’ll be building our own version. 😏 Unlike Docs, we’ll have a full sidebar to work with, and clicking on an emoji won’t automatically insert it. Instead, it’ll copy it into our buffer, so we can paste it wherever we need it. 🎉
That being said, let’s dive into using our most important tool: Vite. ⚡
Welcome to the Ultimate Google Ultimate Google Apps Script Front-End Development Guide!
If you are reading this post, then you likely have experience with Google Apps Script. Essentially, there are three types of front-ends that you can create with Apps Script:
Web apps
Modal/modeless dialogues
Sidebars
In this blog post series, we will only discuss HTML front-ends, as this is where you can create the most powerful and sophisticated user experiences. Unfortunately, the Card Service is outside the scope of this series, and it is not nearly as powerful as an HTML front-end. With that in mind, Google, how about allowing HTML front-ends for Workspace add-ons?
This is a sample script for exporting Google Docs files (Spreadsheets, Documents, and so on) in PDF format with batch requests using Google Apps Script.
As a reference sample situation, in order to export 100 Google Document files as PDF files, when I tested this sample script, the processing time was about 150 seconds and no error occurred. And, I confirmed that 100 valid PDF files were created in my Google Drive.
Kanshi Tanaike has been busy again, this time looking at how you can handle batch exports from Google Docs, Sheets and Slides using Google Apps Script. There is quite a bit of engineering to get your head around but if you are looking for a copy/paste solution everything is well commented for you to drop this code into your own project. If you’d like more context about the solution there is a related post on Stack Overflow.
When I create some applications using Google Drive, there are often the case which is required to retrieve the file list and folder list. I had prepared the script each time for each case so far. But recently, I thought that if there is a library for retrieving the file and folder list (as a tree), it will be useful for me and other developers.