google-docs

How does Google Docs achieve content editing?

无人久伴 提交于 2019-12-08 02:07:49
问题 Inspecting the DOM of a google docs page, I can't find any elements with the contentEditable attribute set. I even tried traversing the DOM, looking at isContentEditable ... all set to false . What gives? How is google docs achieving editability? 回答1: Google Docs uses its own editing surface instead of contenteditable. It draws its own selection and caret and handles most key and mouse events manually. I think it may have a hidden contenteditable iframe that it uses to collect user input but

Excel formula to get string between 2 characters

核能气质少年 提交于 2019-12-08 02:06:18
问题 I'm trying to dynamically extract the string between 2 characters in Excel using a formula (no text to columns). The sample data is: US - Blue Widgets - Net UK - Green - Grass UAE - Red - Apples * Note that the data doesn't have fixed length I tried using a formula, but I think I'm missing something because that also returns the string after the last - . Formula: =TRIM(LEFT(SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"-","|",1))+1,LEN(A2)),"_",REPT(" ",LEN(A2))),LEN(A2))) what this returns is:

Get all nested Text Elements in a Google Doc using Selection's RangeElements

核能气质少年 提交于 2019-12-07 23:49:40
问题 In a document similar to the above, I can get all the paragraphs with the following code: var paras = body.getParagraphs(); Notice that the code above not only returns the top level paragraphs but also returns all the sub-level paragraphs inside ListItem s, Table s etc. How can I do the same thing within a selected range? Following code only returns top level elements. const selection = DocumentApp.getActiveDocument().getSelection(); var rangeElements = selection.getRangeElements(); For

Text formatting for strings in Google Documents from Google Apps Script

守給你的承諾、 提交于 2019-12-07 23:29:19
问题 I have some Google Apps scripts that use the DocumentApp .replaceText method to find a text string in a Google Document and replace it with a different text string. var file = DocsList.getFileById('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); var newTextString = 'foo\nbar'; file.replaceText('Old text string',newTextString); The \n works to make line breaks, but is there a way to format the text with bold/italics/colors/etc? I tried to use HTML tags and inline CSS styles with the span tag, but

apps script findText for docs

不问归期 提交于 2019-12-07 22:53:44
问题 I know that the findText function for Google Doc elements doesn't use regular regex (it uses RE2, instead). I'm coming up against a regex issue where a validated, relatively simple, and seemingly supported regex block is paradoxically returning a null result in Apps Scripts. Wondering if anyone can spot/explain the reason. Thanks! I'm applying the code below to a block of text with some markdown code block ticks (```). The RegEx returns correct results when I paste the regex shown below into

How to import a page break from html to google docs?

六月ゝ 毕业季﹏ 提交于 2019-12-07 19:26:40
问题 I'm trying to export a document in html and import it again (for the purpose of the test I don't even edit the file). After exporting, I can see that the page break is kept in the html : <hr style="page-break-before:always;display:none;"> But after I import this file into google docs, and do the conversion, the page break is not materialized in the document. I can only see a line where the pagebreak should be. Is there is a way to make it working ? PS: I'm using the python gdata v3 API. 回答1:

Filter rows by date (A column) and write sum (C column) to field in another sheet

非 Y 不嫁゛ 提交于 2019-12-07 19:09:08
问题 I have two sheets in Google Spreadsheet document. The first one has columns Month, Income, Expense and Profit (A,B,C,D respectively) and in each row expense value should be calculated based from filter (I think) from another sheet called Expenses. The Expenses sheet contains columns Date, Name and Price. So, what I need is to write formula to filter only expenses for specific month, to sum all prices in those rows and to write that value to C column (row for that month) in first sheet. You

How to check out code from old version with Google docs add-on script

浪子不回头ぞ 提交于 2019-12-07 13:30:41
问题 I made an add-on that worked on 05/21. At some point between then and now it broke. The old code is no longer in the revision history which only goes back to 05/22. I have tested version 1 , and it works, which means it's using the right code. I can run this working version, but I don't know how I can re-open the code for it. How do I view the code for version 1 of my add-on? EDIT From @BryanP's comment, I've been informed that there is an existing request for this here. 回答1: It's a bit round

How to merge data from different sheets that use the same template?

て烟熏妆下的殇ゞ 提交于 2019-12-07 11:14:01
问题 I have one spreadsheet which has 5 sheets All the sheets share the same template, so they are alike. The only difference is the data I would like to make another sheet, whichs gets all the data from column A3 (from row 3 to the end) in sheet 1,2,3,4,5, and puts it in 1 column in my new sheet. How is this possible? I am using Google Docs, but i guess Excel and Google Docs are much alike. Thanks 回答1: =CONCATENATE(Sheet1!A:A,",",Sheet2!A:A,",",Sheet3!A:A,",",Sheet4!A:A,",",sheet5!(A:A)) This

Google drive unable to share

这一生的挚爱 提交于 2019-12-07 08:53:35
问题 I cannot share on my google drive. I've tried all the usual stuff (turning it off and on again, clearing cashe, cookies etc.), and all I get is the message 'Sorry, sharing is unavailable at this time. Please try again later.' No ideas of how to go about this. Any ideas? 回答1: Clearing cookies and browsing history fixed this for me. 回答2: For sure it is something to do with browser settings, I would suggest upload your docs via laptop or desktop and you can later share it from mobile device.