Google Apps Script
Google Apps Script is a cloud-based scripting platform provided by Google that allows users to automate, extend, and integrate Google Workspace applications such as Gmail, Google Sheets, Google Docs, Google Calendar, etc. It is based on JavaScript and enables the creation of custom scripts and applications to enhance productivity and streamline workflows.
Apps Script can be used to:
- Automate repetitive tasks (e.g., generating reports or sending emails).
- Build custom menus, sidebars, and dialogs in Google Workspace apps.
- Create web apps or APIs that interact with Google services.
- Integrate third-party APIs with Google Workspace tools.
Resources
- Google Apps Script for Beginners (YouTube)
- Apps-Script-Samples (GitHub) by Google
- Google-Apps-script-Awesome-List
Helpful Apps Script Tools
- Google Apps Script Github Assistant (Chrome extension): Allows integration with GitHub so that code can be pushed to or pulled from a GitHub repo.
- Black Apps Script (Chrome extension): Customizable dark mode for Apps Script IDE
- Apps Script Libraries (Chrome extension): Libraries are code (possibly written by someone else) that one can plug into an Apps Script project so that you can run functions from it. Seamless search and integration of Apps Script libraries directly within the Google Apps Script IDE. This is currently in beta at the time of writing and I have not used this but I like the idea.
Using Classes in Libraries
I found that one cannot access a class object in a library. If you redefine it as a var then you can.
var Log = class Log {
static method () {
}
}
Redefining the class as a var allows it to be referenced in another project.
My code
- Common Library: A central library for common functions I use, mostly for integration with Google Sheets
See Programming
Scope and Permissions
Errors can be caused later on when permission is not given to do the tasks a script it trying to do.
Go to myaccount.google.com/permissions to remove the permissions for the project and then re-run a function. This will now ask again for permission for whatever is listed in the scope in manifest.json