google-apps-script

MailApp not sending with large number of recipients

ぃ、小莉子 提交于 2021-01-28 05:06:49
问题 My code takes an input of emails that looks like this: email1@gmail.com, email2@gmail.com, email3@gmail.com ... and tries to send them an email using the following code. function sendEmail(form) { var ss = SpreadsheetApp.getActive(); var body = form.body; var bcc = form.bccfield; var cc = form.ccfield; var to = form.tofield; var subject = form.subject; var eHandle = ss.getSheetByName("Email Handling"); var sig = eHandle.getRange(10, 2).getValue(); var img = eHandle.getRange(11, 2).getValue();

MailApp not sending with large number of recipients

人盡茶涼 提交于 2021-01-28 05:03:17
问题 My code takes an input of emails that looks like this: email1@gmail.com, email2@gmail.com, email3@gmail.com ... and tries to send them an email using the following code. function sendEmail(form) { var ss = SpreadsheetApp.getActive(); var body = form.body; var bcc = form.bccfield; var cc = form.ccfield; var to = form.tofield; var subject = form.subject; var eHandle = ss.getSheetByName("Email Handling"); var sig = eHandle.getRange(10, 2).getValue(); var img = eHandle.getRange(11, 2).getValue();

Delete old files from a Google Drive folder

我的未来我决定 提交于 2021-01-28 04:33:37
问题 I created this script to delete files published more than 3 hours ago. And even if the latest file is older than 3 hours, it will not be deleted, so the folder will never be empty. I enabled google's advanced service called DRIVE API V2. I activated a trigger to analyze the folder every 5 minutes, but often the files are not deleted, they remain in the folder. The script works sometimes yes and sometimes no. I would like to know what is wrong or what I need to edit to make it work perfectly.

Delete old files from a Google Drive folder

本小妞迷上赌 提交于 2021-01-28 04:31:04
问题 I created this script to delete files published more than 3 hours ago. And even if the latest file is older than 3 hours, it will not be deleted, so the folder will never be empty. I enabled google's advanced service called DRIVE API V2. I activated a trigger to analyze the folder every 5 minutes, but often the files are not deleted, they remain in the folder. The script works sometimes yes and sometimes no. I would like to know what is wrong or what I need to edit to make it work perfectly.

Check if the execution is running in debug mode

随声附和 提交于 2021-01-28 04:20:29
问题 Is there a way to check if Google Apps Script is running in debug mode ? For an example, I have a script for which I use prompt but, in debug mode, I want to set predefined values for these prompt. 回答1: Try debugging myfunc() with debugMyFunc(); function debugMyFunc() { myfunc('debug'); } function myfunc(mode) { var mode=mode||'run'; } 回答2: Problem If you are looking for an analog of a debug environment, then no, there is no dedicated way - the only mode is production (although some services

Copying data after deleting empty rows in Google Sheets using Apps Script?

99封情书 提交于 2021-01-28 03:44:03
问题 The following code is working fine. It is sorting, removing duplicates and deleting empty rows. Then I just want to copy the rows of data to after the last data row. But the code is copying the rows of data with empty rows. Need to avoid empty rows while copying var column = 3; range.sort({column: column, ascending:true}); range.removeDuplicates([column]); //now delete empty rows if any for (var i = range.getHeight(); i >= 1; i--){ if(range.getCell(i, 1).isBlank()){ sheet.deleteRow(range

How can I modify a trigger so that it emails upon edit, but not so quickly?

旧巷老猫 提交于 2021-01-28 02:57:23
问题 I have a script that creates additional files upon submission of a Google Form. It also sets up a trigger for said new document, so that people are emailed when any edits are made to the document after its creation, e.g. ScriptApp.newTrigger("sendEmailOnModification") .forSpreadsheet(SpreadsheetApp.openById(fileId)) .onEdit() .create(); The logic all works, but... the trigger is extremely sensitive. Every time someone makes a single keystroke in the document, it fires. It doesn't make a lot

How do I format my text in Google Script, for it to show when I send an email?

烂漫一生 提交于 2021-01-28 02:51:39
问题 I have been trying to edit a script that I have to bold certain text. This script pulls information from a Google Form Spreadsheet and returns an email that looks like this: Teacher Engagement: At initial observation, the teacher is appropriately engaged (Direct Instruction, Modeling, Constructing Knowledge, Guided/Independent Practice, etc.) Technology Integration: No evidence of technology use or integration I would like for the headers "Teacher Engagement:" & "Technology Integration" to be

Script for Selecting random data from a list on button press

ⅰ亾dé卋堺 提交于 2021-01-28 02:34:53
问题 I'm creating a spreadsheet which can automatically select random cell data from a particular column when I press a button. However, I cannot figure out the script. Thanks to some friends I've tried a few variations that involve using add-ons but ideally I don't want to use anything like that as it needs to be usable if people wanted to make a copy without the addons. What I'm looking to do is click a particular button and then the adjacent cell displays a random value from the data set given

Copying data after deleting empty rows in Google Sheets using Apps Script?

一世执手 提交于 2021-01-28 02:32:11
问题 The following code is working fine. It is sorting, removing duplicates and deleting empty rows. Then I just want to copy the rows of data to after the last data row. But the code is copying the rows of data with empty rows. Need to avoid empty rows while copying var column = 3; range.sort({column: column, ascending:true}); range.removeDuplicates([column]); //now delete empty rows if any for (var i = range.getHeight(); i >= 1; i--){ if(range.getCell(i, 1).isBlank()){ sheet.deleteRow(range