google-docs

Why does MailApp.sendEmail from Google Spreadsheet Script not Work?

只谈情不闲聊 提交于 2019-12-02 04:20:32
问题 I'm Trying to send email using MailApp.sendEmail in a Google Spreadsheet Script following this example: https://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/ by @mhawksey see: https://docs.google.com/spreadsheets/d/1mhY_hJMMPTmxq3TFAUHK0tKFhGYBpzus-dXE3U5TQdc/edit?usp=sharing The Test web app for your latest code. function works . ( email is sent ) But when I try to trigger the sendEmail() via a POST request it does not

Weird Behaviour with DriveApp.getFileById()

六眼飞鱼酱① 提交于 2019-12-02 02:53:09
Code is still in Proof of Concept phase - Will try to explain the expected result and what result I am getting. This script will be a generic mail merge. The script is expected to do the following: Prompt user for ID of template file to be used. (Google Docs Document) Make a copy of the template and change values in the body of the copy of the template. Get the edited copy of the template and attach it to an email. Do this once for every row in the spreadsheet. While everything above works really well the weird behaviour comes when attaching the edited copy of the template. Instead of getting

google doc script to capitalize sentences

↘锁芯ラ 提交于 2019-12-02 00:52:22
问题 i am writing the google doc script below to capitalize the sentences in a document. function cap6() { var body = DocumentApp.getActiveDocument().getBody(); var text = body.editAsText(); var str1 = text.getText(); Logger.log(str1); // define function "replacement" to change the matched pattern to uppercase function replacement(match) { return match.toUpperCase(); } // period followed by any number of blank spaces (1,2,3, etc.) var reg = /\.(\s*\s)[a-z]/g; // capitalize sentence var str2 = str1

Google apps spreadsheet parents folder ID

浪尽此生 提交于 2019-12-01 21:06:43
问题 I have a google spreadsheet that is keeping track of the files and their names that are inside the folder where the spreadsheet is. I have looked and can not find how to get the location or ID of that sheet In MS CMD script it would be "%~dp0". How to do this in google apps spreadsheet script. function FnctnMenuUpdateGetLocation() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var SSID=ss.get.getId(); var file = DocsList.getFileById(SSID); Browser.msgBox(SSID); Browser.msgBox(add); } https

Using my own Google Docs addon without publishing it

半腔热情 提交于 2019-12-01 20:35:25
I have just made an addon for Google docs, successfully tested it and now I would like to use it. It's very simple, it just shows the id of the current document. This is the most important part of the script, just called by the onOpen(e) function: DocumentApp.getUi().alert(DocumentApp.getActiveDocument().getId()) When I tested it by the Publish/Test as addon (I am not sure with English titles, I translated the button names from Czech) it works exactly as I want. How can I use it the same was as I would download it from the webstore? I don't want to publish it, because it isn't much useful for

Embedded Google Docs PDF viewer displays login page rather than PDF

白昼怎懂夜的黑 提交于 2019-12-01 20:24:31
I have a Web page in which I embed a Google docs viewer in an iFrame <iframe src="http://docs.google.com/viewer?url=URL-encoded-URL&embedded=true" width="750" height="960" style="border: none;"></iframe> (where URL-encoded-URL is an actual encoded URL). For many/most of my users, the Google PDF Doc viewer appears and displays the referenced PDF. But some of my users instead see the Google Docs page with the login box. I've no idea why that happens. Has anyone heard of this happening? And more important, know why, and what can be done to ensure the PDF is shown. I second Zhami's comment on the

Google Drive API get file Edit URL

眉间皱痕 提交于 2019-12-01 17:31:58
As of 04/20/2015 the Google Documents API v3.0 is deprecated, and will no longer function function on and after this date. So anyone using this API must switch to use the Google Drive API. I have integrated the Google Drive API into my PHP application, but I can not find how to get a EDIT url for a file I have created or uploaded. Previously in the Google Documents API after uploading a file, the response would return a edit url that would be a direct url to edit the file. I am using a service account that uses a generated key by my google developers account at https://console.developers

Google Drive API get file Edit URL

萝らか妹 提交于 2019-12-01 16:23:30
问题 As of 04/20/2015 the Google Documents API v3.0 is deprecated, and will no longer function function on and after this date. So anyone using this API must switch to use the Google Drive API. I have integrated the Google Drive API into my PHP application, but I can not find how to get a EDIT url for a file I have created or uploaded. Previously in the Google Documents API after uploading a file, the response would return a edit url that would be a direct url to edit the file. I am using a

Replaced text in a Doc is missing in converted PDF

我的未来我决定 提交于 2019-12-01 14:27:48
I am starting in Google Apps Script and trying to create a copy of a file (Google Doc), then replace text in the copied document and convert it to PDF. The function works fine, but the text replaced does not appear in the PDF file, but appears in the copied file (where I replaced). I read about the saveandclose() method to save changes and close the document (copied) before the function finishes to eject. But it seem that the method is not available. I really appreciate the help. Thanks. function replaceconvert() { var cdoc = DriveApp.getFileById('iddocument').makeCopy('filename321'); var

Replaced text in a Doc is missing in converted PDF

末鹿安然 提交于 2019-12-01 12:40:30
问题 I am starting in Google Apps Script and trying to create a copy of a file (Google Doc), then replace text in the copied document and convert it to PDF. The function works fine, but the text replaced does not appear in the PDF file, but appears in the copied file (where I replaced). I read about the saveandclose() method to save changes and close the document (copied) before the function finishes to eject. But it seem that the method is not available. I really appreciate the help. Thanks.