google-docs

Creating Google Docs file by getting data from Google Sheets.

耗尽温柔 提交于 2019-12-11 07:57:38
问题 I am an experienced programmer who isn't experienced with using the script editor of Google Drive. Since I need to make some reports, I was wondering about ways to exploit the script functionale of Google Drive to ease my process. So my goal is there's this format that I created in Words, and for some parts of the Words, I need to put in each student's score. However, as doing this manually is very demanding, i was wondering ways to utilize google sheets and google docs for this. So I was

Google Apps Script to highlight multiple choice

情到浓时终转凉″ 提交于 2019-12-11 06:29:45
问题 I'm trying to make a Google Apps Script that will highlight multiple choice answers in a Google Doc. Here's an example question: Question....blah blah blah. a. Answer 1 b. Answer 2 c. Answer 3 d. Answer 4 e. Answer 5 And here's what I've got so far for a script: function highlight() { var doc = DocumentApp.openByUrl('https://docs.google.com/document/d/1nP6ra0zIMI3OB-zsTMbFybO2e7ajoYgQi8doDcurGew/edit?usp=sharing'); var style = {}; style[DocumentApp.Attribute.BACKGROUND_COLOR] = '#E3E65B'; var

Is there any Web API for Google web clipboard?

℡╲_俬逩灬. 提交于 2019-12-11 05:43:02
问题 Google Docs have a feature "Web Clipboard" to help users easily copy and paste cross google documents. (you can refer to https://drive.googleblog.com/2010/02/a-web-clipboard-for-google-docs.html) But I am wondering that if there's any Web API or official way to access those API. I try to find in Google Document List APi (https://developers.google.com/google-apps/documents-list/), I can't find any related stuff. The original goal for me is I want to copy some screenshot/images/text from my

How do i use DocumentApp.getui() on a new doc

别等时光非礼了梦想. 提交于 2019-12-11 05:37:52
问题 So i have been trying to make a script that makes a doc and then uses Document.getUi() var doc = DocumentApp.create('New') var Func = DocumentApp.getUi() //Blah blah blah but when I do this it gives me an error how can i fix this. 回答1: The error received is: Cannot call DocumentApp.getUi() from this context. This is consistent with the documentation for getUi() : "A script can only interact with the UI for the current instance of an open document, and only if the script is bound to the

Google AppScript dies with “Service Unavailable: Docs”

自作多情 提交于 2019-12-11 04:39:29
问题 I wrote an app script that should break down a wall of text into separate paragraphs. function onOpen() { DocumentApp.getUi() .createMenu('Formatting tool') .addItem('Make Paragraphs', 'breakIntoParagraphs') .addToUi(); } function breakIntoParagraphs() { var body = DocumentApp.getActiveDocument().getBody(); var counter = 0; body.replaceText("\\v\\v+", "°"); // the ° is more convenient to handle var rangeElement = body.findText("°"); while (rangeElement != null) { var start = rangeElement

gDoc python API import failure

*爱你&永不变心* 提交于 2019-12-11 04:16:35
问题 When I try to use gDoc python API following instruction at python_client_lib I got below error: In [3]: import gdata --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-3-fc99779d388d> in <module>() ----> 1 import gdata /Users/e12714/git/bin/anaconda/lib/python2.7/site-packages/gdata/__init__.py in <module>() 107 108 --> 109 class LinkFinder(atom.LinkFinder): 110 """An "interface" providing methods to find

Form to perform action and passover the values

ぐ巨炮叔叔 提交于 2019-12-11 03:42:15
问题 Hi i basically have a form that has a two textboxes which will send the data back to the google spreadsheet, as i have attached my form to the google form, if u know how to do this then its ok, if not u can take a look here http://www.morningcopy.com.au/tutorials/how-to-style-google-forms/lets call them, <form action="LINK TO GOOGLE SPREAD SHEET LINK" method="post"> <input type="text" id="tb1" name="tb1"/> <input type="text" id="tb2" name="tb2"/> <input type="submit" value="submit"/> </form>

Google app script copy document page

余生颓废 提交于 2019-12-11 03:38:42
问题 I have a template document in Google Docs containing one page. I would like to create a new document with N pages each identical to the one page from the template document. How can I do this? 回答1: Please have a look at this post from Henrique, it uses the different doc elements following the definitions available in the doc... you should pick the one you need and add the corresponding routine. Here is how it goes (code from the original post): function mergeDocs() { var docIDs = ['list-of',

Regular Expression Carriage Return Find & Replace on Google Docs

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 03:28:54
问题 On Google Docs , I want each list-item (my bullet is an en dash, " - "), of which there are over 1,000 in 20 or so documents, to be separated by an additional line feed. It makes it easier to read on mobile devices. How can I search for a line feed delimiting a bullet, and replace it with two line feeds? (I.e. the equivalent of searching for " ^p- " and replacing it with " ^p^p- " in Microsoft Word) 回答1: I am a little confused about your question, but: I found the only way to do something

Use RegEx in Google Doc Apps Script to Replace Text

試著忘記壹切 提交于 2019-12-11 02:28:58
问题 There is a line in a Google Doc that has a time and date stamp. I have written the following code using a regex to replace that line with the current time/date, but I am not sure why this isn't working. function UpdateDate() { var document = DocumentApp.getActiveDocument(); var date = new Date(); var regExp = /[0-9]{1,2}:[0-9]{2} [A-Z]{2} [A-Za-z]* [0-9]{1,2}, [0-9]{4}/; document.replaceText(regExp, Utilities.formatDate(date, 'America/Denver', 'h:mm a MMMM dd, yyyy')); } If I replace the