google-docs

How can control the date format when generating a google docs (PDF) from a google spreadsheet with script?

╄→尐↘猪︶ㄣ 提交于 2019-12-23 04:47:09
问题 I generate a PDF file from a sheet of Google (that is populated with Google form) using a script and a template with Google Docs. But doing this I obtain that in google sheets date are in dd/mm/yyyy format while in the final PDF it's like this = Sat Feb 27 2016 00:00:00 GMT+0100 (CET) The "core" of the script is (for each row of the google sheet) var copyFile = DriveApp.getFileById(TEMPLATE_ID).makeCopy(FileName); var copyId = copyFile.getId(); var copyDoc = DocumentApp.openById(copyId); var

Google Doc's (Spreadsheet) get Revision Id

≡放荡痞女 提交于 2019-12-23 04:29:10
问题 I'm testing this page: https://developers.google.com/drive/v2/reference/revisions/get#try-it I can't find the revision id and when i try put something like i think is the revision id, an error is displayed saying: "message": "Revision not found: " How i can find the revision id of the file (i'm trying for Spreadsheet)? Later i'll try to use (in java): RevisionList revisions = service.revisions().list(fileId).execute(); return revisions.getItems(); But for now i need to do manually. 回答1: It

Google Doc's (Spreadsheet) get Revision Id

走远了吗. 提交于 2019-12-23 04:29:03
问题 I'm testing this page: https://developers.google.com/drive/v2/reference/revisions/get#try-it I can't find the revision id and when i try put something like i think is the revision id, an error is displayed saying: "message": "Revision not found: " How i can find the revision id of the file (i'm trying for Spreadsheet)? Later i'll try to use (in java): RevisionList revisions = service.revisions().list(fileId).execute(); return revisions.getItems(); But for now i need to do manually. 回答1: It

Display Form in Sidebar

限于喜欢 提交于 2019-12-23 04:28:59
问题 I am not sure if what I am trying to do is even possible. I am trying to put a google form into the sidebar of a google doc. Right now I have an apps script document plugin that opens the sidebar fine, and I am able to open the form using var form = FormApp.openById('form_id'); But I don't know how to get a html object or blob from a form element that I could use to embed the form in the sidebar. I also can't use iframes as those are disallowed. 回答1: While you can display a google form in a

Google Script: How to highlight a group of words?

自作多情 提交于 2019-12-22 17:44:05
问题 I'd like to write a script for google docs to automatically highlight a set of words. For one word I could use a script like this: function myFunction() { var doc = DocumentApp.openById('ID'); var textToHighlight = "TEST" var highlightStyle = {}; highlightStyle[DocumentApp.Attribute.FOREGROUND_COLOR] = '#FF0000'; var paras = doc.getParagraphs(); var textLocation = {}; var i; for (i=0; i<paras.length; ++i) { textLocation = paras[i].findText(textToHighlight); if (textLocation != null &&

Google Docs spreadsheet formula for most frequent keywords

隐身守侯 提交于 2019-12-22 09:12:33
问题 I wonder if there is a formula in Google Docs Spreadsheet which could identify and display (for example in column D) the most frequent (key)words in a spreadsheet? Let's say that I have a column (Column B) full of tweets (see example image) and I would like to find top keywords in the column B and display them in column D. Is there a way to do that? Thank you! 回答1: To return the top 10 individual words in column B, with their frequency, try: =ArrayFormula(QUERY(TRANSPOSE(SPLIT(JOIN(" ";B3:B);

Google API for Google Docs, requesting a list of documents — 400 Bad Request

让人想犯罪 __ 提交于 2019-12-22 06:51:31
问题 After authentication from google servers for google docs, I do a simple getResponse, but I get a 400 Bad Request. I can't understand where am I going wrong. The sample code is, below private void executeRefreshAlbums() { HttpRequest request = transport.buildGetRequest(); request.url = GoogleDocsUrl.forDefaultPrivateFull(); System.out.println("URL = "+request.url); try { HttpResponse response = request.execute(); System.out.println("Response = "+response.getContent()); } catch (IOException e)

Accessing google docs revision history through the API using R?

痴心易碎 提交于 2019-12-22 05:04:43
问题 I wish to download and analyse the revision history of one of my google docs using R, finding out statistics like how many edits did whom. I see that there are already some ways for accessing google docs using R. Does anyone know upfront (before I go ahead and try to hack my way), if or how it might be (reasonably easily) done? Thanks. 回答1: The Google Documents List API gives you access to a list of revisions, the contents of each revision, a way to make sure that a revision is stored for a

Capture keypress in Javascript (Google Docs)

孤者浪人 提交于 2019-12-21 19:56:55
问题 I'm trying to write a little greasemonkey script/bookmarklet/what have you for Google Docs. The functionality I'd like to add needs a keypress/keyup/keydown event handler (one of those three). Unfortunately, Javascript isn't my forté, and I can't seem to capture (?) a keypress event to while in the edit pane. As a last resort, I've tried the following: javascript:(function(){ els = document.getElementsByTagName("*"); for(i=0;i<els.length;i++){ els[i].onkeypress=function(){alert("hello!");};

Google Docs viewer disable download

老子叫甜甜 提交于 2019-12-21 16:53:48
问题 Please take a look at this link http://jsfiddle.net/C7Py6/3/ The last icon on google viewer's toolbar - enables user to view on new browser window and download PDF. The question is, how can I make it view only and disable download (At least disable this toolbar item). Is that possible with google viewer? or is there any other viewer that works like Google Viewer but view-only? 回答1: You can host your PDF files on Google Docs and prevent viewer downloads. To do this do followings: Once you