google-docs

How To Format A Block of Code Within a Presentation? [closed]

£可爱£侵袭症+ 提交于 2019-12-02 13:52:25
I am preparing a presentation using Google Slides, though I can also work on the presentation within Open Office that will include code snippets. Is there any easy way to perform basic syntax highlighting on the code snippets with either Google Docs or Open Office Presenter? Edit: Since I believe that I can find a way to embed HTML, any tools that can perform syntax highlighting on HTML would also be welcome suggestions. An on-line syntax highlighter: http://markup.su/highlighter/ Just copy and paste into your document. EDIT: Seems the above site is temporarily down so heres an alternative:

How to add Header/Footer to with Google Docs API

半世苍凉 提交于 2019-12-02 13:51:35
I want to add header and footer to an existing Google Docs file using Google Docs API . Looking at the documents.batchUpdate ( link ) we can insert text, replace text, add images and table etc by mentioning them in the JSON payload with objects like replaceAllText , insertText etc but I cannot find any way to insert header and footer. Question 1: How can I add header and footer? Question 2: How can I add different header/footer for the first page of document? If not possible, suggestion to use any other API or method (like using MS Word) will be much appreciated. Thank you in advance. How

How can I get the next or previous character of findText()

戏子无情 提交于 2019-12-02 13:21:05
How can I get the next or previous character of findText() . function myFunction() { var doc = DocumentApp.getActiveDocument(); var str = doc.getbody(); var i = "f"; var x = str.findText(i); var y = str[str.index(x)-1]; Logger.log(y); } It is not working. and get some error. Example: string = "Abcdefgh" , var x=string.findText("f"); after found "f"; want to get previous char of "f". which is "e" in this case. I want to know special function in google script to get Flow: getBody() returns a body object . You need string type. getText() returns string. Use regexp#exec to get previous and next

Google Scripts - Find and Replace Function that searches multiple documents

痴心易碎 提交于 2019-12-02 13:03:28
问题 I'm new to Google Scripts and am looking for a good place to start and educate myself on being able to write a script that accomplishes the following: It scans a number of different google docs and does a find and replace, essentially a mail merge, as instructed by the code. So basically each doc would have a [REPLACE TEXT HERE] already in it and I'd tell the script that I'd like each [REPLACE TEXT HERE] changed to [WORD A] for a number of different documents. I understand this is may be a

Pull csv to Google Sheets with basic authentication

会有一股神秘感。 提交于 2019-12-02 12:25:48
I need to pull a csv from a URL that requires basic auth. I have found this code that works, apart from parsing the csv, clearing and setting the cells. I think there is a few bugs as it is old code, such as clear.contents() should be clear.content() . And even with hard coding the data in where sheets is, im still struggling to get it to work, has anyone else found a solution?: // this function assumes the CSV has no fields with commas, // and strips out all the double quotes function parseCsvResponse(csvString) { var retArray = []; var strLines = csvString.split(/\n/g); var strLineLen =

Paragraph character in URL?

泄露秘密 提交于 2019-12-02 11:40:57
I just ran across this an Google App Engine article that uses that funny backwards 'P' character in some URL's (look near the top of the first code box). You know that character that your high school English teacher used to mark new paragraphs (which I've learned, thanks to Wikipedia, is called a "pilcrow"). I've never seen this in a URL. So which is it? This has a standard specific meaning which is ... This is a typo, it should be ... This is something that somebody at Google just made up. What they might mean is ... What character? I'm seeing things. &para is in the URL which forms part of

Importing a HTML table into a google doc using google app script

不羁岁月 提交于 2019-12-02 10:23:12
I'm importing data from JIRA into a Google Doc. One of the fields would be the description, which is basically HTML text. Is there any way to "add" this HTML text on a Google Doc? Or do I really have to parse it manually and create paragraphs, tables, etc.? The HTML could look as follows: <p>Hello There</p> <table class='confluenceTable'> <tbody> <tr> <th class='confluenceTh'> Name </th> <th class='confluenceTh'> Hours </th> <th class='confluenceTh'> Cost </th> </tr> <tr> <td class='confluenceTd'> Some Person</td> <td class='confluenceTd'> 1 </td> <td class='confluenceTd'> CHF 1</td> </tr> <

Weird Behaviour with DriveApp.getFileById()

痞子三分冷 提交于 2019-12-02 09:17:39
问题 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

Sum vertically until empty cell on Google Sheets

≯℡__Kan透↙ 提交于 2019-12-02 08:32:00
This is the scenario. I need to get the sum of the values until it reaches a blank cell. After that it should start again calculating the sum after the blank cell. I need to add the fat and carbs of every ingredient of each dish individually. This is the expected result. That for each of hundreds of dishes. In this case I entered the data manually: I tried with this but is adding all of the data from the column: IF(SUM(C3:C)="","",SUM(C3:C))) I also tried with this formula but is not working: IF(C3:C="","",SUM(INDIRECT(ADDRESS(ROW(C3:C),COLUMN(C3:C400))&":"&"C"&MIN(ARRAYFORMULA(IF(C3:C400=""

Detect conflict when uploading document to Google Drive

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 07:47:55
My Android app updates a Google Drive document. The file can be modified also elsewhere (e.g. through Drive web interface), so there may be a conflict on file upload. However, this should rarely happen. That's why I don't want my app to first query the revision history (since this is in most cases unnecessary) and only after that, update the file. How can I detect that there is a conflict when updating the file? My investigation so far reveals that getHeadRevisionId() returns null although the null head revision id has been reported fixed . Another thing I tried was setEtag() on the file