google-apps-script

After Chrome version 83 release, file download in modal dialog doesn't work

寵の児 提交于 2020-06-09 04:40:47
问题 I use Google Apps Script to make download Spreadsheet data quickly. Since several days before, download function doesn't work suddenly. Some of my coworkers who can use the function use chrome version 81.0.4044.138(Official Build) and who cannot use the function , chrome version 83.0.4103.61(Official Build) (right-click and [save as] works fortunately) I want to know what should I do to make one-click download function active again. Script is as follows. /** * Adds a custom menu * * @param

How to upload an existing file in Drive to Drive using Apps Script

守給你的承諾、 提交于 2020-06-08 19:26:30
问题 Introduction Let me first introduce the goal of what I am trying to do. I had a file split into two parts earlier Size of both of these files together may exceed 50 MB (as a long term goal). Since UrlFetchApp.fetch() has restriction regarding the size of the request, I want to upload them separately, where each file will be less than 50 MB and consequently merge them. For now (to try the Drive API), I am using small files. First file is of 640000 bytes (a multiple of 256 ) 524288 bytes . I

How to use HtmlService in Gmail add-on using App Script

£可爱£侵袭症+ 提交于 2020-06-08 18:31:05
问题 I am creating a Gmail Add-on. The following reference page says - https://developers.google.com/gmail/add-ons/reference/ "Gmail add-ons are built using Apps Script and the many services it provides. You can use any of the Apps Script services when building your add-on" Basically, I want to have the small screen to pop up on clicking a button in my Gmail add-on. As of now I have added a button in my section as follows and tied it to an action handler 'htmltest':- var htmlTest = CardService

Google Sheets onEdit(e) TypeError: cannot read property

自古美人都是妖i 提交于 2020-06-07 07:18:48
问题 I'm trying to implement the onEdit(e) simple trigger of Google Sheets. Everytime I try execute even a simple function such as: function onEdit(e){ Logger.log(e.oldValue); } I get the following error: My step by step: I've tried following these two videos with no success: https://www.youtube.com/watch?v=eWn_JxPSbds https://www.youtube.com/watch?v=L1_nIhiVc5M EDIT: SOLUTION Thanks to @JPV and @TheMaster for the two potential solutions: I was viewing the "Logs" and not the "Stackdriver Logging".

MailApp.sendEmail method doesn't get through to accounts with URL in the body - Message Blocked

痞子三分冷 提交于 2020-06-07 06:59:54
问题 I am working on Google Apps Script. I am trying to send email as follows: function test_sendmail(){ var subject = "subject"; var body = "https://www.google.com/"; var emailBody = body; var options = { htmlBody: body } var recipient = "XXXXXXXXX@gmail.com"; MailApp.sendEmail(recipient, subject, emailBody, options); } "XXXXXXXXX@gmail.com" (email address A) is not valid, but it's only for showing you an example. I use a real email address in the GAS execution. The GAS execution is run by

MailApp.sendEmail method doesn't get through to accounts with URL in the body - Message Blocked

走远了吗. 提交于 2020-06-07 06:57:08
问题 I am working on Google Apps Script. I am trying to send email as follows: function test_sendmail(){ var subject = "subject"; var body = "https://www.google.com/"; var emailBody = body; var options = { htmlBody: body } var recipient = "XXXXXXXXX@gmail.com"; MailApp.sendEmail(recipient, subject, emailBody, options); } "XXXXXXXXX@gmail.com" (email address A) is not valid, but it's only for showing you an example. I use a real email address in the GAS execution. The GAS execution is run by

What amount of JsDoc is supported in Google Sheets custom functions?

痞子三分冷 提交于 2020-06-06 08:27:07
问题 Google implies that JsDoc is supported: Custom functions will appear in this list if their script includes a JsDoc @customfunction tag, as in the DOUBLE() example below. https://developers.google.com/apps-script/guides/sheets/functions But it doesn't seem that JsDoc is supported in full, and I can't find the documentation that shows what is supported and not. I'm particularly looking for a way to document that a parameter for a custom function is optional . Like this, for value2: Image

How can you monitor for click events in Google Apps script for spreadsheets?

你离开我真会死。 提交于 2020-06-06 07:31:25
问题 I'm managing a Google spreadsheet with a script. onEdit is working - I can colour a cell red by putting SpreadsheetApp.getActiveRange().setBackgroundRGB(255, 0, 0); in the onEdit function. I would like to put the same code in a onClick function, so that when a user clicks on a cell it immediately turns red. Is this possible? I can't find any way to do it in the documentation. 回答1: As stated on the comments above before there's no way (right now) to create an onClick() function for Google

How to insert file to a shared drive using REST on Apps Script?

与世无争的帅哥 提交于 2020-06-01 07:37:04
问题 Is there a way that we can upload files to shared drive using POST Method? I don't know how to call the Drive ID of the shared drive and target it to the URL fetch function, is this possible? This is my code: var DriveScope = 'https://www.googleapis.com/auth/drive'; var ServiceAccountPrivateKey ="-----BEGIN PRIVATE KEY----" var ServiceAccountEmail = "drive-uploads@xxxxxxx.com"; function testinRest(){ var service = getDriveService(); var driveID = "XXXXXXXX"; var APIKey = "XXXXXXXXXXXXX"; var

Lock a sheet when date in column > 24 hours: Google Sheets - Scripteditor?

狂风中的少年 提交于 2020-06-01 07:12:52
问题 In order to prevent data loss caused by other contributors, I'd like to lock an entire sheet for all data < today. It needs to be possible to do input and make changes for entries today. An simple example of the master file : EXAMPLE - LOCK < TODAY So, each row will lock for others when the date in column A < today. This link brought me closer but I'm having difficulties with var range = ss.getRange('1:1').getValues()[0]; which gives me an error on line 31: "TYPE-ERROR: can't find function