AppsScriptPulse

Get permissions of a Shared drive

The following Google Apps Script is designed to get permissions of a given Shared drive. It uses the Shared drive ID to then list a users email address and role they have. This page on Google Drive permissions is useful for what we need to put together to make the call.

Source: The Gift of Script: Get permissions of a Shared drive

Bulk create Google Drive folders with a sub-folder

Bulk create Google Drive folders with a sub-folder from data given in a Google Sheet. Optional user permissions can be added.

Bulk create Google Drive folders from a Sheet of data

Bulk create Google Drive folders from a Sheet of data

This tool and blog post is largely a continuation of this one for bulk creating Google Drive folders. The main difference being that there is an extra column to provide the name of your sub-folder. Note that the tool will try to create a sub-folder regardless of what is entered – as I was just aiming to create a version for the many requests I got from the previous blog post from people who wanted a sub-folder.

Source: The Gift of Script: Bulk create Google Drive folders with a sub-folder

Save PDF from URL directly to Google Drive using Google Apps Script

There is a PDF file on the Internet. Say this one. And you want to save it to your Google Drive. The tedious way is to download it to your computer. … and then upload it to your Google Drive. (Seems like too much work.) If only you could send the PDF straight from where it is stored on the Internet, to your Google Drive…

Nice little snippet which shows how you can add .pdf files to Google Drive.

Source: Save PDF from URL directly to Google Drive using Google Apps Script

Learn how to build an image library with Google Drive and a little Google Apps Script

With Google Drive, Apps Script, Bootstrap, and a little jQuery, you can develop an Image Library web application with search and download functionality!

Useful little tutorial if you are interested in learning how to interact with Google Drive files. The post is also a nice introduction into using the Bootstrap framework for building responsive web apps.

Source: Image Library

How to Move Files Uploads from Google Forms to a Specific Folder in Google Drive – Digital Inspiration

The File Upload feature of Google Forms lets you receive files from form respondents directly in your Google Drive. You may add the File Upload question in your Google Form to receive PDF assignments from students, résumé applications, portfolio images from contestants, and so on.

When a respondent uploads a file through Google Forms, the file are stored in a fixed folder of your Google Drive. All files are uploaded in the same folder and, thus looking at the file in your Google Drive, it is difficult to determine which respondent has uploaded which set of files.

Learn how to organize file uploads and attachments from Google Forms and move files to a specific folder in Google Drive.

Source: How to Move Files Uploads from Google Forms to a Specific Folder in Google Drive – Digital Inspiration

Google Drive Monitor – Get Email Alerts When Files are Deleted in your Drive with Google Apps Script – Digital Inspiration

Monitor your Google Drive automatically and get email alerts when important files and folders are deleted from your Google Drive. You can also watch file activity in Shared Drives

Source: Google Drive Monitor – Get Email Alerts When Files are Deleted in your Drive – Digital Inspiration

How to Make your Documents Read-only in Google Drive using Google Apps Script – Digital Inspiration

Your documents and files in Google Drive can be modified by anyone who has edit access to the file. You can always remove external collaborators from your documents to prevent them from editing your files but how do you prevent yourself (the owner) from accidentally editing your own files in Google Drive? Google Drive doesn’t have a simple button (yet) for locking files so here’s a little Google Script that can help you make any file in your Google Drive read-only.

Nice post from Amit Agarwal showing how the new Google Drive Locking API can be used with Google Apps Script. The post contains all the code and instructions you need to get started.

Source: How to Make your Documents Read-only in Google Drive – Digital Inspiration

Converting SVG Format to PNG Format using Google Apps Script · tanaike

This is a sample script for converting the SVG image data to PNG image data using Google Apps Script. Unfortunately, in the current stage, there are no methods for directly converting the SVG to PNG in Google Drive service. But it can be achieved by Drive API

Nice trick to get .svg files stored in Google Drive in a raster format.

Source: Converting SVG Format to PNG Format using Google Apps Script · tanaike

The Gift of Script: Bulk create Google Docs from Google Sheet data

The following is designed to bulk create Google Docs from rows of data within a Google Sheet and to include some of that data within the new Doc body (so they become customised files). It also creates a link to the new Google Doc back in the Sheet on the relevant row.

Rows of data in a spreadsheet will transfer into a Doc

Example rows of data in a Google Sheet

Source: The Gift of Script: Bulk create Google Docs from Google Sheet data

Bulk create Google Drive folders 2.0 with Google Apps Script

The following was developed to bulk create Google Drive folders with data from a given spreadsheet (eg to name the folders and add permissions). It is an improved version of the tool built in April 2019

Source: The Gift of Script: Bulk create Google Drive folders 2.0