google-docs

How to copy ListItems from one Google Document to another while preserving numbering?

ε祈祈猫儿з 提交于 2021-02-07 10:27:03
问题 The accepted answer to How to copy content and formatting between Google Docs? indicates that we have to add conditional code just to copy elements. But I cannot get it to work for ListItem types, because the target document shows the list items without the original numbering. var source_doc = DocumentApp.getActiveDocument(); var selection = source_doc.getSelection(); if (!selection) { var ui = DocumentApp.getUi(); ui.alert('Please make a selection first.'); return; } var target_doc =

add-on with LIMITED auth cannot open sidebar

坚强是说给别人听的谎言 提交于 2021-02-06 12:47:42
问题 I have a Google docs add-on which is programmed to open the sidebar as soon as the document is open. Of course this requires the add-on to be installed and enabled in the document. I see that, since a week, the sidebar auto open feature, which is very useful in our use case, no longer works. In StackDriver logs I see this report : onOpen(): {authMode=LIMITED, source=Document, user=} publi-2.0.72-2017-11-27-18-57 [this is the publication version tag] 2017-11-27T18:02:50.126Z : show menu 2017

R code on Google docs

烈酒焚心 提交于 2021-02-06 12:44:27
问题 I'm aware that you can publish spreadsheets on Google docs and then import them in R. However, let's say I have a function or some code I want to read in R (like in the source function). How would you for example read in all this code stored on google docs? https://docs.google.com/document/edit?id=1f11rcVs9AtVcgOyiP0lV04yq9hshVDIPx93lA0ItFvQ I don't think this has been published but it's just to give an example. Basically I want to: Create a function in R (for comparability see example below)

On form submit trigger - scripting results from a Google Docs Form

六眼飞鱼酱① 提交于 2021-02-04 19:58:58
问题 I have a form that submits data which will require testing and manipulation once the new form data is appended to the spreadsheet. Therefore I hope to use an "On form submit" trigger to process the latest entry (new last line). However before I get too deep into scripting for that trigger, I am curious to know if the "On form submit" trigger is reliable. For instance, does it trigger immediately? And what happens if 2 (or more) form submissions occur simultaneously (or near-simultaneously)?

On form submit trigger - scripting results from a Google Docs Form

让人想犯罪 __ 提交于 2021-02-04 19:58:31
问题 I have a form that submits data which will require testing and manipulation once the new form data is appended to the spreadsheet. Therefore I hope to use an "On form submit" trigger to process the latest entry (new last line). However before I get too deep into scripting for that trigger, I am curious to know if the "On form submit" trigger is reliable. For instance, does it trigger immediately? And what happens if 2 (or more) form submissions occur simultaneously (or near-simultaneously)?

On form submit trigger - scripting results from a Google Docs Form

巧了我就是萌 提交于 2021-02-04 19:58:10
问题 I have a form that submits data which will require testing and manipulation once the new form data is appended to the spreadsheet. Therefore I hope to use an "On form submit" trigger to process the latest entry (new last line). However before I get too deep into scripting for that trigger, I am curious to know if the "On form submit" trigger is reliable. For instance, does it trigger immediately? And what happens if 2 (or more) form submissions occur simultaneously (or near-simultaneously)?

What's the preferred way to insert a bulleted list into a Google Doc using Google Apps Script?

老子叫甜甜 提交于 2021-02-04 06:19:25
问题 I'm trying to get familiar with Google Apps Script in a Google doc and want to be able to insert a bulleted list with various levels of nesting. I thought I was using body.insertListItem correctly, but what's odd is that when I add subsequent list item, it seems to mess up the nesting levels and glyphs of previously inserted items. For example, here's my sample code: function myFunction() { var doc = DocumentApp.getActiveDocument() var body = doc.getBody() var cursor = doc.getCursor() var

What's the preferred way to insert a bulleted list into a Google Doc using Google Apps Script?

岁酱吖の 提交于 2021-02-04 06:19:05
问题 I'm trying to get familiar with Google Apps Script in a Google doc and want to be able to insert a bulleted list with various levels of nesting. I thought I was using body.insertListItem correctly, but what's odd is that when I add subsequent list item, it seems to mess up the nesting levels and glyphs of previously inserted items. For example, here's my sample code: function myFunction() { var doc = DocumentApp.getActiveDocument() var body = doc.getBody() var cursor = doc.getCursor() var

Get the first hyperlink and its text value

一笑奈何 提交于 2021-01-29 18:49:02
问题 I hope everyone is in good health health and condition. Recently, I have been working on Google Docs hyperlinks using app scripts and learning along the way. I was trying to get all hyperlink and edit them and for that I found an amazing code from this post. I have read the code multiple times and now I have a good understanding of how it works. My confusion My confusion is the recursive process happening in this code, although I am familiar with the concept of Recursive functions but when I

How to copy image from one table cell to another within google documents using a google script (programmatically)?

痞子三分冷 提交于 2021-01-29 09:49:53
问题 I would like to copy the content of one google doc to another. The content includes text, tables and images. My code copies the text and the tables. However, whatever is contained in table cells is not copied. I made a simplified version of the code and single document accessible here: https://docs.google.com/document/d/1hcQzBuMA6E15u8VtW2lWGL7XCcU3qVsDhn-5jiznQP4/edit?usp=sharing. The code simply copy-pastes the content of the google document which includes a table containing a table/images.