Skip to content

Instantly share code, notes, and snippets.

View phillypb's full-sized avatar

Phil Bainbridge phillypb

View GitHub Profile
/**
* A number of global variables that are re-used throughout this script.
*/
// 5 minute maximum runtime
var maxRuntime = 5 * 60 * 1000;
var ss = SpreadsheetApp.getActiveSpreadsheet();
/**
* A number of global variables that are re-used throughout this script.
*/
// 5 minute maximum runtime
var maxRuntime = 5 * 60 * 1000;
var ss = SpreadsheetApp.getActiveSpreadsheet();
/**
* A number of global variables that are re-used throughout this script.
*/
// 5 minute maximum runtime
var maxRuntime = 5 * 60 * 1000;
var ss = SpreadsheetApp.getActiveSpreadsheet();
/**
* Developed by The Gift of Script: https://www.pbainbridge.co.uk/
*/
function checkEmailAddresses() {
// create regular expression for testing valid email address
var emailAddressRegEx = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/gm;
/**
* Function to change ownership of a Google Drive item (within your organisation) without sending an email
* notification.
*
*
* DEVELOPED BY THE GIFT OF SCRIPT: https://www.pbainbridge.co.uk/
*/
function changeOwnership() {
/**
* Developed by The Gift of Script: https://www.pbainbridge.co.uk/
*/
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Admin')
.addItem('Fix Dates', 'fixDates') // label for menu item, name of function to run.
/**
* Function to create menu items for Trigger
*/
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Admin')
.addItem('Create Trigger', 'createTrigger') // label for menu item, name of function to run.
/**
* 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() {
/**
* 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";
function checkTriggers() {
// get active spreadsheet
var ss = SpreadsheetApp.getActiveSpreadsheet();
// get all existing Triggers
var triggers = ScriptApp.getUserTriggers(ss);