google-apps-script

Get file content with Google Apps Script Advanced Drive API - Drive.Files.get - or export

吃可爱长大的小学妹 提交于 2020-03-21 06:57:23
问题 I need to get the file content of a text file using the Google Apps Script Advanced Drive Service . This question is specific to Google Apps Script. It is possible to get file content by making an HTTPS Request using the Drive API, but I don't want to make an HTTPS Request. So, I'm not asking for a "work around" or a way that does not use the Advanced Drive Service . It is possible to get file content using an HTTPS Request to the Drive REST API using the file's self link and the "alt=media"

Get file content with Google Apps Script Advanced Drive API - Drive.Files.get - or export

丶灬走出姿态 提交于 2020-03-21 06:57:22
问题 I need to get the file content of a text file using the Google Apps Script Advanced Drive Service . This question is specific to Google Apps Script. It is possible to get file content by making an HTTPS Request using the Drive API, but I don't want to make an HTTPS Request. So, I'm not asking for a "work around" or a way that does not use the Advanced Drive Service . It is possible to get file content using an HTTPS Request to the Drive REST API using the file's self link and the "alt=media"

Why can't I call a server function from the sidebar in Google AppScript for Sheets?

做~自己de王妃 提交于 2020-03-19 14:38:47
问题 I'm having problems calling a server-side AppScript function from a html sidebar in Google Sheets. I've replicated my issue with the simple example code below. What it should do Clicking the button should call alert in my Code.gs script and display an alert to the user. What actually happens Clicking the button shows the error: We're sorry, a server error occurred while reading from storage. Error code PERMISSION_DENIED. There are no entries in the 'executions' section of the AppScript

Why can't I call a server function from the sidebar in Google AppScript for Sheets?

爷,独闯天下 提交于 2020-03-19 14:32:57
问题 I'm having problems calling a server-side AppScript function from a html sidebar in Google Sheets. I've replicated my issue with the simple example code below. What it should do Clicking the button should call alert in my Code.gs script and display an alert to the user. What actually happens Clicking the button shows the error: We're sorry, a server error occurred while reading from storage. Error code PERMISSION_DENIED. There are no entries in the 'executions' section of the AppScript

How do I rewrite this code for V8 from Rhino?

▼魔方 西西 提交于 2020-03-16 08:08:35
问题 I used to a script on GAS. Because I do manage attendance by Chat and Google spread sheet with GAS. Chat tool is Chat work. It works on Gas(Rhino). But It doesn't work V8. I tried to rewrite line19 for each (var obj in json){ to for (var obj in json){ Please tell me what is bad... Which should I rewrite it? function recordTime(){ /*Sheet setting*/ var wsData = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("data"); //DataSheetSetting var wsStaff = SpreadsheetApp.getActiveSpreadsheet()

How do I rewrite this code for V8 from Rhino?

倾然丶 夕夏残阳落幕 提交于 2020-03-16 08:08:10
问题 I used to a script on GAS. Because I do manage attendance by Chat and Google spread sheet with GAS. Chat tool is Chat work. It works on Gas(Rhino). But It doesn't work V8. I tried to rewrite line19 for each (var obj in json){ to for (var obj in json){ Please tell me what is bad... Which should I rewrite it? function recordTime(){ /*Sheet setting*/ var wsData = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("data"); //DataSheetSetting var wsStaff = SpreadsheetApp.getActiveSpreadsheet()

Search Pattern Error since Google Scripts V8 Update

半城伤御伤魂 提交于 2020-03-16 07:36:44
问题 Ever since google forced the update "This project is running on our new Apps Script runtime powered by Chrome V8." I'm getting the following error and I don't understand why. "Exception: Invalid argument: searchPattern at recreateReferral(recreateReferral:82:13)" Here is the snippet of code: Line 82 starts with newBody. for(i = 0; i <=16; i++) { newBody.replaceText(fields[0][i], newData[0][i]); } 回答1: Possible cause(s): Your original rhino script is buggy, because it doesn't check the type of

Google script replaceAllShapesWithImage with image from drive doesn"t work any more

扶醉桌前 提交于 2020-03-10 04:37:35
问题 Since yesterday one of my google script doesn't work anymore. The script take an image on the drive copie a slide replace a shape with an image But I got this error: "The provided image is in an unsupported format." -> I give all access to the image: it doesn't change anything -> The script work if I take an url outside the drive Any idea function test_image(){ var imageUrls = DriveApp.getFilesByName("DSC_3632.png"); var file = "undefined"; while ( imageUrls.hasNext()) { var file = imageUrls

Google script replaceAllShapesWithImage with image from drive doesn"t work any more

有些话、适合烂在心里 提交于 2020-03-10 04:35:10
问题 Since yesterday one of my google script doesn't work anymore. The script take an image on the drive copie a slide replace a shape with an image But I got this error: "The provided image is in an unsupported format." -> I give all access to the image: it doesn't change anything -> The script work if I take an url outside the drive Any idea function test_image(){ var imageUrls = DriveApp.getFilesByName("DSC_3632.png"); var file = "undefined"; while ( imageUrls.hasNext()) { var file = imageUrls

MailApp.sendEmail Not Working?

爷,独闯天下 提交于 2020-03-09 04:39:08
问题 I have several scripts in Google Docs spreadsheets that use MailApp.sendEmail to send e-mails incorporating data from the spreadsheets. They've all worked marvelously for years. About 2 weeks ago, they stopped sending the e-mails. The scripts still run and I don't get any errors. The e-mails just never come through. Nothing has changed, except that the e-mails aren't arriving anymore. Any thoughts? Thanks! 回答1: I think I have an answer to my own question, which may be helpful to anybody else