Gists
This report is a workaround for reflecting the latest Google Apps Script to the deployed Web Apps without redeploying.
Pattern 1 Of course, when the developer mode of https://script.google.com/macros/s/###/dev is used, the latest script can be used without redeploying.
But, in this case, only the permitted users can use it using the access token. when you want to achieve this using the endpoint of https://script.google.com/macros/s/###/exec without the access token, in order to reflect the latest script to Web Apps, it is required to redeploy.
Gists
This is a sample script for searching Gmail messages by Gmail Filters using Google Apps Script.
At Gmail, users can set the filter for the Emails. With this filter, users can filter the Emails of Gmail. But, when the users want to search by the installed filter using Google Apps Script, unfortunately, it seems that this cannot be directly achieved. For example, messages cannot be searched using a filter ID.
Gists
These are sample scripts for retrieving specific folders from Google Drive using Google Drive service (DriveApp) with Google Apps Script.
Retrieving folders in own Google Drive const folders = DriveApp.searchFolders( `'${Session.getActiveUser().getEmail()}' in owners and trashed=false` ); const res = []; while (folders.hasNext()) { const folder = folders.next(); res.push(folder.getName()); } console.log(res); Retrieving folders in shared Drives const folders = DriveApp.searchFolders( `not '${Session.getActiveUser().getEmail()}' in owners and trashed=false` ); const res = []; while (folders.
Gists
This is a workaround for converting a Gmail message to a PNG image using Google Apps Script.
Sample script Please set the message ID of Gmail.
function myFunction() { var id = "###"; // Please set your message ID of Gmail. var message = GmailApp.getMessageById(id); var date = Utilities.formatDate( message.getDate(), Session.getScriptTimeZone(), "yyyy-MM-dd HH:mm:ss" ); var from = message.getFrom(); var to = message.
My report has been featured by Google Workspace Developer Newsletter. Ref
The featured report is “Report: Implementing Pseudo 2FA for Web Apps using Google Apps Script”.