google-docs

Is it possible to get or set the position of tab-stops (left, center or right ones)?

折月煮酒 提交于 2019-12-06 11:12:31
问题 (with Google Apps Script Documents) I can't get positions of the left, center or right tab-stop programmatically (with apps script). Is this possible to set or get positions like indents of paragraph (getIndentFirstLine()) ? 来源: https://stackoverflow.com/questions/49836768/is-it-possible-to-get-or-set-the-position-of-tab-stops-left-center-or-right-on

Importing javascript table into Google Docs spreadsheet

こ雲淡風輕ζ 提交于 2019-12-06 10:49:28
问题 I am attempting to import the leaderboard at pgatour.com/leaderboard.html or golf.com/leaderboard (sorry, can't post more than 2 links since I have <10 reputation). Based on my research, it seems that the IMPORTHTML & IMPORTXML functions are unable to retrieve the data because the table doesn't actually exist at the time the import function runs, as the table/data is loaded via javascript after the function reads the page's html/xml. Example: =IMPORTXML("http://www.golf.com/leaderboard","//*[

Text formatting for strings in Google Documents from Google Apps Script

穿精又带淫゛_ 提交于 2019-12-06 09:47:00
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 that didn't work, it just outputs the text including the tags. I remember how Google Docs used to have an

How to create an account on Google Apps to use Google Apps Extensions Console?

三世轮回 提交于 2019-12-06 09:29:15
问题 I am asking this question because the information on tutorials is terribly vague for a novice. Concretely, I am trying to put up an extractor to use in Gmail Contextual App. Here is where it gets complicated. To make a Gmail Contextual App, I need to upload my app code as extractor on Google Apps Extensions Console, but I am just unable to access or know where is this page. All it say here is that Point your browser to http://code.google.com/googleapps/console/a/yourDomainName. Well I did

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

依然范特西╮ 提交于 2019-12-06 09:10:47
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. I've also been looking for this. It seems this is as easy as adding: <hr class="pb"> Credit: https:/

Excel formula to get string between 2 characters

非 Y 不嫁゛ 提交于 2019-12-06 07:32:54
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: Blue Widgets - Net Green - Grass Red - Apples here's what I'd like it to return: Blue Widgets Green Red

Google Script: How to highlight a group of words?

人盡茶涼 提交于 2019-12-06 07:25:32
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 && textLocation.getStartOffset() != -1) { textLocation.getElement().setAttributes(textLocation.getStartOffset()

google docs textcursor

杀马特。学长 韩版系。学妹 提交于 2019-12-06 06:54:34
问题 I need to create an application which is similar to google docs. I have seen that google docs doesn't use any textarea but regular divs to create pages. But what I don't know is how they manage to get a text cursor. Is it an image blinking? cause I didn't see any image when i tried to see the webpage code with chrome developer tools. How do they do it? 回答1: Google Docs uses unique editing method. There is no text ares with contentEditable on, but everything is rendered using DOM. It listens

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

て烟熏妆下的殇ゞ 提交于 2019-12-06 06:30:58
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 example, the table above contains 9 non-empty paragraphs and I'd like to process them one by one if they are

Google Docs viewer in IE

瘦欲@ 提交于 2019-12-06 04:59:14
问题 I've searched high and low for a solution, but can't find one. I'm using Google Docs Viewer to view PDF files. It's a great tool, but I can't seem to get it working in Internet Explorer (7 or 8). All my images come up as a 'missing' icon. If I view the file externally, it seems to load fine and it will start working (I'm assuming because the images are being cached). The document is being displayed in an iframe and works in all other browsers. Has anyone come across a solution to get it to