google-docs

Google Apps Script document not accessible by replaceText()

不问归期 提交于 2019-12-01 11:58:37
问题 Here is my code and I can't figure out why replaceText() isn't working. function createDoc(){ var templateid = "1jM-6Qvy47gQ45u88WfDU_RvfuSTsw27zBP_9MfsUGr8"; // get template file id var FOLDER_NAME = "Completed Rental Agreements"; // folder name of where to put doc // get the data from an individual user var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getActiveSheet(); var data = sheet.getRange(2, 1, sheet.getLastRow()-1,sheet.getLastColumn()).getValues(); var lastRow = sheet

Google Apps Script document not accessible by replaceText()

淺唱寂寞╮ 提交于 2019-12-01 11:53:48
Here is my code and I can't figure out why replaceText() isn't working. function createDoc(){ var templateid = "1jM-6Qvy47gQ45u88WfDU_RvfuSTsw27zBP_9MfsUGr8"; // get template file id var FOLDER_NAME = "Completed Rental Agreements"; // folder name of where to put doc // get the data from an individual user var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getActiveSheet(); var data = sheet.getRange(2, 1, sheet.getLastRow()-1,sheet.getLastColumn()).getValues(); var lastRow = sheet.getLastRow(); var firstName = sheet.getRange(lastRow, 2, 1,1).getValues(); var lastName = sheet

Google Apps Script; Docs; convert selected element to HTML

六月ゝ 毕业季﹏ 提交于 2019-12-01 11:11:24
I am just starting with Google Apps Script and following the Add-on quickstart https://developers.google.com/apps-script/quickstart/docs In the quickstart you can create a simple add-on to get a selection from a document and translate it with the LanguageApp service. The example gets the underlying text using this: function getSelectedText() { var selection = DocumentApp.getActiveDocument().getSelection(); if (selection) { var text = []; var elements = selection.getSelectedElements(); for (var i = 0; i < elements.length; i++) { if (elements[i].isPartial()) { var element = elements[i]

Open a save file dialog for a js variable

与世无争的帅哥 提交于 2019-12-01 10:33:09
In my web app I need to give the user the option to save a js variable as a file (when the user clicks download, the app offers him to save a file, preffereably as .js file). Similarly as google docs offers you to save a file. Is it possible for javascript to pass it's variable this way? Check out Downloadify which allows exactly this. Downloadify is a tiny JavaScript + Flash library that enables the generation and saving of files on the fly, in the browser, without server interaction. it requires Flash installed in the user's browser to work, though. I know of no other way of doing this

Google Drive API - Changes: list. Getting the original ID of a deleted file

£可爱£侵袭症+ 提交于 2019-12-01 08:24:58
When trying to detect deleted objects using the Changes: list feed, I noticed that the id value is incorrect making it impossible for me to detect which file was deleted. Example: Make new testfile : This is a test file public 'title' => string 'This is a test' (length=14) public 'id' => string '1wUFHe3DfU1mJnyqlIgAYSvMrIy8F91-7rZyAPFsyVpg' (length=44) Now when I delete this file the first entry for a deleted change is: public 'deleted' => boolean true protected 'fileType' => string 'Google_Service_Drive_DriveFile' (length=30) protected 'fileDataType' => string '' (length=0) public 'fileId' =>

Get JSON of container-bound Google Apps-Script through Apps-Script or download

不打扰是莪最后的温柔 提交于 2019-12-01 08:20:53
问题 If you create a non-container bound g-apps script (i.e. not as part of a gDoc or a gSheet), you can download it (however not view as a .json directly in the browser from the link) from gDrive as a .json. If you download a gDoc or gSheet, it converts to xlsx or docx and opening these with a zip viewer shows a number of files (many of type xml) however none contain the Google version's attached scripts. Is there a way to read script files as a .json from within another Google Apps Script?

Display the pdf file(stored in google drive) in webview by using google docs

﹥>﹥吖頭↗ 提交于 2019-12-01 08:15:25
My pdf file is stored in some website ex: http://www.pdf995.com/samples/pdf.pdf Now I can't rely on other websites for my app. So I've downloaded the pdf doc uploaded in google drive Got my own link for pdf Trying to open that in webview using google docs FAILED Now the links are as follows pdf stored in other website link: " http://www.pdf995.com/samples/pdf.pdf " Sharable link of pdf saved in google drive: " https://drive.google.com/open?id=0B8e4zX5Y1S0XV0U0UTZJOUVma00 " If it's preceded with google docs : " https://docs.google.com/gview?embedded=true&url=https://drive.google.com/file/d

Display the pdf file(stored in google drive) in webview by using google docs

随声附和 提交于 2019-12-01 06:36:18
问题 My pdf file is stored in some website ex: http://www.pdf995.com/samples/pdf.pdf Now I can't rely on other websites for my app. So I've downloaded the pdf doc uploaded in google drive Got my own link for pdf Trying to open that in webview using google docs FAILED Now the links are as follows pdf stored in other website link: "http://www.pdf995.com/samples/pdf.pdf" Sharable link of pdf saved in google drive: "https://drive.google.com/open?id=0B8e4zX5Y1S0XV0U0UTZJOUVma00" If it's preceded with

Google Apps script- iterating through words in a paragraph

我们两清 提交于 2019-12-01 06:20:39
So basically I have a paragraph with some text underlined, but not all text is underlined. I want to be able to iterate through the selected text and change the text size of the UN-underlined text. Essentially I want the underlined text to stick out more. Is there a way to iterate through the paragraph and check if each word is underlined? The text element in GAS has a isUnderlined() function but that doesn't do me any good since I only know how to grab the entire element. Thanks for your help in advance! Sorry if this is confusing. I can explain more if needed. Here is some code that

Google Drive API - Changes: list. Getting the original ID of a deleted file

旧时模样 提交于 2019-12-01 06:14:15
问题 When trying to detect deleted objects using the Changes: list feed, I noticed that the id value is incorrect making it impossible for me to detect which file was deleted. Example: Make new testfile : This is a test file public 'title' => string 'This is a test' (length=14) public 'id' => string '1wUFHe3DfU1mJnyqlIgAYSvMrIy8F91-7rZyAPFsyVpg' (length=44) Now when I delete this file the first entry for a deleted change is: public 'deleted' => boolean true protected 'fileType' => string 'Google