Shortcut Custom Google Docs buttons in Ribbon

Introduction

As a blog writer, I often find myself using .txt or .doc files for writing and arranging the content. When I moved from using Microsoft Word to Google Docs, a subtle difference caught my attention — we cannot use keyboard shortcuts to run macros in Google Docs as it runs in the browser.

There’s no doubt that using keyboard shortcuts and custom macros in the Microsoft environment is a dream. You hit a key combo, and boom — magic happens. But Google did think of this problem and gave us a solution in their own unique way. I like to call it Brilliant Buttons — custom Google Docs buttons organized as drop-down commands added to the ribbon, created using Google Apps Script.

This article will walk you through:

  • What these Brilliant Buttons are
  • How to create them using Google Apps Script
  • Why they are powerful (with examples)
  • The limitations you should be aware of
  • A comparison between Microsoft Word and Google Docs automation
  • And finally, how I personally use them to speed up my workflow

Let’s get started. 🚀

🧠 What Are Brilliant Buttons?

Brilliant Button is just a made up name. Google documents call it (1) “Custom Menus in Google Docs using Apps Script”. A very boring name indeed. Hence, we will stick with Brilliant Buttons. These are custom menu options we can add to our Google Docs interface using Google Apps Script. Unlike Microsoft Word’s macros, these don’t require local installations or complex add-ons — just a bit of script, and you’re ready to automate!

Image 1

1. Create the Menu

To understand it better. Let’s generate a custom button called “Brilliant Buttons.” Simply open the App Script and past the following in a new script.

function onOpen() {
  DocumentApp.getUi()
    .createMenu("Brilliant Buttons")
    .addItem("Mark as Done", "markDone")
}

As you can see the short code above is enough to display a new menu button in a google doc file. The program will also generate a sub button called “Mark as Done” using .addItem to generate the drop down list inside the menu Brilliant Buttons. Now, the Mark as Done button is the actual powerhouse that calls other app scripts to run when the button is pressed.

2. Create the Button

Now, suppose you were randomly sitting one day in an office and someone barged in and called “Arron” and left. What happened? What are you supposed to do? You dont even know who is Arron. Hence, you will ignore it and continue to do what you were doing. Similarly, if we tell Mark as Done button, markDone. It has no idea what to do with it. As there is not more information about it in the vicinity (App Script.) It will simply ignore the call.

Google requires that all the components of a program must be in one location. Hence to make this button work we must specify what program it is supposed to run when we call it to run. Here we have two options. We can either write the markDone program in the same script or we can create a new script and simply call that script in the button script as shown below:


function runProcessDocWithGPT() {
  processDocWithGPT(); // This calls the function defined in another script tab
}

Now, we can make as many buttons as we want using .addItem and add as many complex logics in these buttons as we want by simply calling functions or calling functions within functions. I will share an example at the end where I used Chat GPT’s API to run some operations on the doc file.

3. Save and Run

Assuming that you have created a markDone app script. Now, simply click Save, then refresh the document. You’ll now see a new menu called “Brilliant Buttons.”

💪 Why Brilliant Buttons Are Powerful

Image 2

Here’s why I love using them:

  • ⚡Speed: No need to navigate through multiple menus or tools. Click once, done.
  • 🎯Customization: You can create buttons for your workflow — not just predefined templates.
  • 🤝Collaboration: Team members with access to the doc can use the same menu.
  • 🔗Scalability: Integrate with the entire Google’s ecosystem like Google Sheets, Docs, Gmail, or even external APIs like ChatGPT, Rest APIs etc.

🧾 Comparison: Microsoft Word vs Google Docs for Automation & LLM Integration

Feature / Use CaseMicrosoft Word (.docx)Google Docs
LLM Integration (like GPT)Manual via VBA macros or Python + Office APIsSeamless via Apps Script + Python + APIs
API SupportLimited (via Office JS API or COM objects)Full Google Docs REST API
Web-Based EditingNot ideal for real-time automationFully cloud-native, easy to integrate
Cross-Device CompatibilityDesktop-focusedExcellent (browser + mobile apps)
Script Access to Document StructureComplex (VBA/OfficeJS, poor granularity)Simple (Apps Script: paragraphs, headings, etc.)
Authentication for API AccessManual, complex with Office 365/Azure tokensEasy with service accounts (OAuth2)
Document Sharing/CollaborationDifficult to manage programmaticallySimple (Drive API + Sharing settings)
Version Control & HistoryLocal file-based, no API-level controlFull version history, accessible via Drive API
Security (API Key exposure risk)High (macros expose keys unless encrypted)Lower (use encrypted server-side functions)
Free AutomationRequires Office licenseFree with Google account

✏️ Real-World Examples of Brilliant Buttons I Use

Image 3
  • ✅ Mark as Done: I created this program to update a Google Sheet. The program extracted the name of the doc file and parsed it to extract a unique Serial ID. This serial ID is further used to identify the row in the google sheet and update a specific column to “Done.”
  • 📁 Make a copy: I created a second program called Copy that would create a copy of this doc file in a folder in google drive who’s name starts with the Unique Serial ID.
  • 🧾 Convert to HTML: HTML is the most powerful program among the others as it performs very specific tasks on the content of the doc file like Headings are converted to HTML tags, tables to table HTML format using LLM mode, etcl.

Each of these saves me minutes per blog — which adds up to hours per week. Although, discussing how I convert the content to HTML is out of scope for this article. But I can share that program too if someone is interested.

❗ Limitations to Be Aware Of

  • ❌ No Keyboard Shortcuts: You can’t assign keyboard shortcuts like Ctrl + Alt + S (yet).
  • 🔒 Requires Manual Permission on First Use: Google asks for authorization when you run a script for the first time.
  • 📄 Only Works in Google Docs (not Sheets/Slides) unless ported separately.
  • ⏳ Slight Lag: Scripts take ~1-3 seconds to run depending on complexity.

But despite these, the benefits far outweigh the downsides, especially when you customize for your needs.

✅ Conclusion

Microsoft gave us macros and shortcut keys. Google gave us Brilliant Buttons — flexible, scriptable commands you can inject into your document’s ribbon to supercharge your writing and automation workflows.

Whether you’re automating SEO, simplifying formatting, or integrating with AI — Brilliant Buttons are one of the most powerful tools hidden inside Google Docs.

Give it a shot. Try building your first button today — and soon, you’ll be wondering how you ever wrote without them.

Scroll to Top