-
getAllLinks.js
-
getAllLinks(element) - returns array of all UrlLinks in Document
-
findAndReplaceLinks(searchPattern,replacement) - changes all matching links in Document
-
changeCase.js - Document add-in, provides case-change operations in the add-in Menu.
-
onOpen - installs "Change Case" menu
-
_changeCase - worker function to locate selected text and change text case. Case conversion is managed via callback to a function that accepts a string as a parameter and returns the converted string.
-
helper functions for five cases
This is a helper function that will convert a given PDF file blob into text, as well as offering options to save the original PDF, intermediate Google Doc, and/or final plain text files. Additionally, the language used for Optical Character Recognition (OCR) may be specified, defaulting to 'en' (English).
Note: Updated 12 May 2015 due to deprecation of DocsList. Thanks to Bruce McPherson for the getDriveFolderFromPath()
utility.
// Start with a Blob object
var blob = gmailAttchment.getAs(MimeType.PDF);
/** | |
* Retrieve a file from the given URL, store into the named folder | |
* on Google Drive. | |
* | |
* @param {String} fileURL URL to source file, e.g. "http://mysite.com/files/file.val1.val22.zip" | |
* @param {String} folder Name of target folder on Google Drive | |
* | |
* @returns {Object} Response of operation, e.g. | |
* {rc:200,fileName:"test.zip",fileSize:92994392} | |
*/ |
/** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
* httpGetTemplate.gs | |
* | |
* A pair of template functions for external host communication with | |
* UrlFetchApp, including parameter encoding and error handling. | |
* | |
* From: gist.github.com/mogsdad/a76c32231a2b91ff8b59 | |
* | |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
function test_listFilesInFolder() { | |
listFilesInFolder("StackOverflow"); | |
} | |
/** | |
* @OnlyCurrentDoc Limits the script to only accessing the current spreadsheet. | |
*/ | |
function onOpen() { |
##sendAndLabel(recipient, subject, body, options, label)##
An alternative to GmailApp.sendEmail(), which applies a label to the message thread in the sender's account.
Sends an email message with optional arguments. The email can contain plain text or an HTML body. The size of the email
// See http://stackoverflow.com/questions/14518410/a-google-apps-script-to-move-or-restore-google-drives-files-from-the-trash | |
var addonName = 'Rescue Files'; | |
var rescueFldrName = 'Rescued Files'; // The name of the folder that rescued files should be placed into | |
/** | |
* Adds an addon menu to the active spreadsheet. | |
*/ | |
function onOpen() { | |
var ui = SpreadsheetApp.getUi(); |
The components involved in this workflow are:
- A script to generate and send an email with an HTML form.
- An html template for that email, which allows us to customize the email for each recipient.
- A
doPost()
function to handle responses. The script must be [deployed as a Web App][1]. - A spreadsheet to collect responses. The script will be contained in the spreadsheet, and extends the spreadsheet UI with a menu for sending a copy of the survey. (It could be adapted for standalone use, without the UI component.)
Here is an example of such a workflow, conducting a Commuting Survey. Recipients will receive a survey email like this:
This is the source repository for the SheetConverter Google Apps Script library.
Libary documentation is available here.
This script is incomplete, ignoring some types of formatting. (Feel free to fork and enhance it, if you wish! Broadly applicable enhancements can be merged and the library updated) There are also some known issues: