Skip to content

Instantly share code, notes, and snippets.

@prantxesko
prantxesko / apps-script.js
Last active August 31, 2022 11:44 — forked from triblondon/apps-script.js
Google apps script for form data to gsheet
// Submit form data directly to Google sheets
//
// (Based on http://railsrescue.com/blog/2015-05-28-step-by-step-setup-to-send-form-data-to-google-sheets/)
//
// ## Setup
//
// 1. Create a Google spreadsheet and name it
// 2. Choose Tools > Script editor
// 3. Replace the sample code with the contents of this file
// 4. Name the script project something like "Submit form data to Google sheet" (click on 'Untitled project' to change name)
@prantxesko
prantxesko / Apps Script pdfToText utility.md
Created March 18, 2021 07:06 — forked from mogsdad/Apps Script pdfToText utility.md
For http://stackoverflow.com/questions/26613809, a question about getting pdf attachments in gmail as text. I got a little carried away - this does much more than asked.

Google Apps Script pdfToText Utility#

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);