AppsScriptPulse

Google Apps Script: Extract Specific Data From a PDF and insert it into a Google Sheet – Yagisanatode

Have you ever asked for a list from a client, another department or agency and instead of saving into a file that might even be considered marginally useful, they give it to you as a pdf.

After some prostrations to the great Google Apps Script gods, I had a though. “Hey, can’t we convert a PDF to a Google Doc with just a click of the button? Surely the great Google Apps Script devs have made it so we can do it programmatically too.” And you know what? They bloody well did. The big legends.

Yagi shares a comprehensive walk-through of how you can sometimes extract data from .PDF documents using Google Apps Script and the advance Drive service. The solution is also able to work on .PDFs created from images using the built-in OCR features of Google Drive and you might want to drop the getTextFromPDF() function shared in the post.

Source: Google Apps Script: Extract Specific Data From a PDF and insert it into a Google Sheet – Yagisanatode

The Gift of Script: Create a Shortcut in Google Drive with Google Apps Script

The following Google Apps Script is designed to create a Shortcut to an existing Google Drive folder, within another folder..

For Google Drive pros you can currently place a file in multiple folders, but Google will be removing this functionality on 30 September 2020. In March Google announced general availability of shortcuts in Google Drive, is is designed to replace the ‘file in multiple locations’ feature. For Google Apps Script developers wanting to migrate to Drive Shortcuts Phil Bainbridge provides this useful Apps Script snippet.

Source: The Gift of Script: Create a Shortcut in Google Drive

G Suite Solutions —  Apps Script Powered Workflow Automation

Laura Taylor recently spoke at SheetsCon on the topic of Automation with Apps Script. During the presentation, she walked through a simple approval workflow for a hypothetical small business to demonstrate the power of Apps Script to automate workflow inside G Suite. She also showcased modern ECMAScript features supported by the new Apps Script V8 Javascript runtime.

The article is an overview of the workflow covered in the author’s presentation along with install instructions for trying it out in your G Suite domain.

Source: G Suite Solutions —  Apps Script Powered Workflow Automation

Bulk save emails from Gmail

Screenshot of setup sheet for tool.

Screenshot of setup sheet for tool.

This tool is designed to bulk save emails (and associated attachments) from a specified Gmail label into a Google Drive folder, with relevant threads combined into a single PDF document.

Source: The Gift of Script: Bulk save emails from Gmail – overview

Apps Script – Adding and removing Drive files and folders

In case you didn’t know, Google Drive has the ability to store files and folders in more than one place at a time. So, you could have a file in a folder for a particular company and have the same file in a different folder which is where you store all the reports. It’s something you can’t do in a traditional computer folder system.

Source: Apps Script – Adding and removing Drive files and folders

Convert Doc to PDF and move into a new folder with Google Apps Script

Create a PDF version of a Google Doc, move it into a new folder, remove its parents so it only exists in the new folder (typically also exists in My Drive) and then trash the Doc.

Source: The Gift of Script: Convert Doc to PDF and move into a new folder

Google Apps Script —Track videos viewed on Google Drive within your organization

SCENERIO: You are admin of a G-Suite set up. You upload training videos for your organization members on Google Drive/Team Drive. To increase productivity, you want to ensure all members watch the videos you upload.

SOLUTION: You utilize this amazing GSuite Reports API and use Google Sheets as your dashboard to view all details about your MP4 videos.

Source: Google Apps Script —Track videos viewed on Google Drive within your organization

Copy template sheet to Google Sheets and reorder

Template sheet with signatures to copy to other files

Screenshot of template sheet with signatures to copy to other files

Take a template Google Sheet (containing fields for 3 signatures) and copy it into other Google Sheet files within a given Google Drive folder and then reorder those sheets so that it was the first one.

The idea was based around needing users to authorise student marks with their signature from multiple Google Sheet reports produced from a third party system.

Source: The Gift of Script: Copy template sheet to Google Sheets and reorder

Batch get existing Google Drive folder IDs & names

Get the folder IDs of a large number of current Google drive folders along with parts of their name – for capturing in a Google Sheet.

Source: The Gift of Script: Batch get existing folder IDs & names – version 2.0

Create alphabetised folders in Google Drive

Screenshot of Google Drive folder layout

The script is designed to bulk create folders from a Google Sheet and to arrange them into alphabetised folders within Google Drive, by extracting the first letter of a user’s surname.

If a suitable alphabetised folder does not exist in Google Drive, then one is created. The script also adds the created folder to an ‘Everybody’ folder so that there is a single area with all the folders listed in.

Source: The Gift of Script: Create alphabetised folders in Google Drive