This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Function to replace <<keyword>> tag in Google Doc with relevant image. | |
| * | |
| * @OnlyCurrentDoc | |
| * | |
| * DEVELOPED BY THE GIFT OF SCRIPT: https://www.pbainbridge.co.uk/ | |
| */ | |
| function replaceTextToImage() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Developed by The Gift of Script: https://www.pbainbridge.co.uk/ | |
| */ | |
| function getFileInfo() { | |
| // ID of the folder to scan for files | |
| var folderId = "ENTER YOUR FOLDER ID HERE"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function checkTriggers() { | |
| // get active spreadsheet | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| // get all existing Triggers | |
| var triggers = ScriptApp.getUserTriggers(ss); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Lock Service - lock code to prevent overwriting data (concurrency). | |
| * https://developers.google.com/apps-script/reference/lock | |
| */ | |
| function onFormSubmit(e) { | |
| // get lock that prevents any user from concurrently running a section of code. | |
| var lock = LockService.getScriptLock(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Script to take a Microsoft Excel file. | |
| * Convert to a Google Sheet, remove unnecessary data/columns/rows. | |
| * Add some data/columns/rows. | |
| * Insert formula to concatenate email addresses. | |
| */ | |
| // enter the ID of the Excel file below |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Function to check if date in spreadsheet is less than todays date. | |
| * If so then autofill formulas down a row. | |
| * Run via daily Trigger. | |
| * | |
| * @OnlyCurrentDoc | |
| */ | |
| function autofill() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getFormData(e) { | |
| // get all Form responses | |
| var formValues = e.namedValues; | |
| // get response to specific question | |
| var pizzaTopping = formValues["Favourite Pizza Topping"][0]; | |
| console.log("pizzaTopping is: " + pizzaTopping); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Function to sort through an array of duplicates, to then create a new array of | |
| unique values. | |
| */ | |
| function sortArray() { | |
| // array to sort | |
| var messyArray = ['A', 'B', 'A', 'C', 'B', 'B', 'B']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Some Global Variables to make it easier to keep a track of changing column | |
| positions, etc. | |
| */ | |
| // 'Folder Name' column number | |
| var folderNameCol = 1; | |
| // 'Folder Link' column number | |
| var folderLinkCol = 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function saveToProperties() { | |
| // save to User Properties in one go | |
| var userProperties = PropertiesService.getUserProperties(); | |
| var newProperties = { | |
| sourceFolderId: '123', | |
| destinationFolderId: '456', | |
| }; | |
| userProperties.setProperties(newProperties); |