background preloader

Google script

Facebook Twitter

Développer Google Documents, Google Feuilles de calcul et Google Formulaires avec Apps Script - Centre d'aide Éditeurs Docs. Bien que l'utilisation de macros n'est actuellement pas possible dans Google Documents, Google Feuilles de calcul ni Google Formulaires, vous pouvez développer les capacités des documents, feuilles de calcul et formulaires en ajoutant des menus, des boîtes de dialogue et des barres latérales avec Google Apps Script, un langage de script simple mais puissant basé sur JavaScript.

Développer Google Documents, Google Feuilles de calcul et Google Formulaires avec Apps Script - Centre d'aide Éditeurs Docs

Dans Google Feuilles de calcul, Apps Script vous permet également d'écrire des fonctions personnalisées. Il vous permet aussi de créer des applications Web et d'interagir avec de nombreux autres services Google, notamment AdSense, Google Analytics, Google Agenda, Drive, Google Finance, Gmail et Maps. Tutorial: Automating a Help Desk Workflow - Google Apps Script. Function getColIndexByName(colName) { var sheet = SpreadsheetApp.getActiveSheet(); var numColumns = sheet.getLastColumn(); var row = sheet.getRange(1, 1, 1, numColumns).getValues(); for (i in row[0]) { var name = row[0][i]; if (name == colName) { return parseInt(i) + 1; } } return -1;} function emailStatusUpdates() { var sheet = SpreadsheetApp.getActiveSheet(); var row = sheet.getActiveRange().getRowIndex(); var userEmail = sheet.getRange(row, getColIndexByName("Contact email")).getValue(); var subject = "Helpdesk Ticket #" + row; var body = "We've updated the status of your ticket.

Tutorial: Automating a Help Desk Workflow - Google Apps Script

\n\nStatus: " + sheet.getRange(row, getColIndexByName("Status")).getValue(); body += "\n\nNotes: " + sheet.getRange(row, getColIndexByName("Notes")).getValue(); body += "\n\nResolution: " + sheet.getRange(row, getColIndexByName("Resolution")).getValue(); // Create a vertical panel.. var panel = app.createVerticalPanel(); // ...and add the grid to the panel panel.add(grid); 4 ways to do Mail Merge using Google Apps Script - Google Apps Developer Blog. Editor’s Note: This blog post is co-authored by James, Steve and Romain who are Google Apps Script top contributors. -- Ryan Boyd The Google Apps Script team is on a roll and has implemented a ton of new features in the last few months.

4 ways to do Mail Merge using Google Apps Script - Google Apps Developer Blog

Some of us “Top Contributors” thought it will be a useful exercise to revisit the Mail Merge use case and discuss various ways in which we can do Mail Merge using Apps Script. Below are several techniques that tap into the power of Google Apps Script by utilizing Gmail, Documents and Sites to give your mailings some zing. Mail Merge is easy and here is how it can be done. 1. The Simple Mail Merge tutorial shows an easy way to collect information from people in a Spreadsheet using Google Forms then generate and distribute personalized emails. 2. The Gmail Service is now available in Google Apps Script, allowing you to create your template in Gmail where it is saved as a draft. 3. Here is a code snippet example to get you started. 4. Happy merging! Apps Script Case Studies - Google Apps Script. Gmail Meter by Romain Vialard, Revevol Gmail Meter is an Apps Script which runs on the first day of every month and sends you an email containing different statistics about your Inbox.

Apps Script Case Studies - Google Apps Script

Similar to how the Google Account Activity gives key stats about how you’ve used your Google Account, Gmail Meter gives you various statistics that will help you analyze your Gmail habits. Gmail Attachment Size by Amit Agarwal, Digital Inspiration Use Google Apps Script to connect to your Gmail account and compute the size of every message that’s present in your mailbox. Tutorial: Simple Mail Merge - Google Apps Script. Installable Triggers   Like simple triggers, installable triggers let Apps Script run a function automatically when a certain event, such as opening a document, occurs.

Installable Triggers  

Installable triggers, however, offer more flexibility than simple triggers: they can call services that require authorization, they offer several additional types of events including time-driven (clock) triggers, and they can be controlled programmatically.   Google Developers. Triggers let Apps Script run a function automatically when a certain event, like opening a document, occurs.

  Google Developers

Simple triggers are a set of reserved functions built into Apps Script, like the function onOpen(e), which executes when a user opens a Google Docs, Sheets, or Forms file. Installable triggers offer more capabilities than simple triggers but must be activated before use. For both types of triggers, Apps Script passes the triggered function an event object that contains information about the context in which the event occurred. Getting started To use a simple trigger, simply create a function that uses one of these reserved function names: The e parameter in the function names above is an event object that is passed to the function.

Restrictions Because simple triggers fire automatically, without asking the user for authorization, they are subject to several restrictions: These restrictions do not apply to doGet() or doPost(). onOpen() onEdit() onInstall() doGet() and doPost()   Google Developers.   Google Developers. MailApp Sends email.

  Google Developers

This service allows users to send emails with complete control over the content of the email. Unlike GmailApp, MailApp's sole purpose is sending email. MailApp cannot access a user's Gmail inbox. Changes to scripts written using GmailApp are more likely to trigger a re-authorization request from a user than MailApp scripts. getRemainingDailyQuota() Returns the number of remaining emails a user can send for the rest of the day. Var emailQuotaRemaining = MailApp.getRemainingDailyQuota(); Logger.log("Remaining email quota: " + emailQuotaRemaining); Return Integer — the number of emails remaining that the script can send sendEmail(message) Sends an email message.

Parameters Advanced parameters See also sendEmail(recipient, subject, body) Sends an email message. MailApp.sendEmail("", "TPS reports", "Where are the TPS reports? ") sendEmail(recipient, subject, body, options) Meet Google Drive – One place for all your files. One account.

Meet Google Drive – One place for all your files

Tutorial: Sending emails from a Spreadsheet - Google Apps Script. Hugo Fierro, Google Apps Script Team May 2009 Goal This tutorial shows how to use Spreadsheet data to send emails to different people.

Tutorial: Sending emails from a Spreadsheet - Google Apps Script

Time to Complete Approximately 10 minutes Prerequisites Before you begin this tutorial, you must: