google-docs

Function for word count in Google Docs Apps Script

不羁岁月 提交于 2019-12-12 17:05:59
问题 Is there a method in Google Apps Scrips that returns the word count from a Google Document? Lets say I'm writing a report that have a particular limit on word count. It's quite precise and it states exactly 1.8k - 2k words (yes and it's not just a single case, but many...) In Microsoft Office Word there was a handy status bar at the bottom of the page which automatically updated the word count for me, so I tried to make one using Google Apps Scrips. Writing a function that rips out whole text

Is it possible to modify the Google Docs/Sheets right-click context menu?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 07:48:48
问题 It's well known on how to make a custom upper menu item (https://developers.google.com/apps-script/guides/menus), but can you append a function to the context menu when right clicking a cell or item? 回答1: No. Can't do it. There is no class or method to modify the right click context menu. 来源: https://stackoverflow.com/questions/27932041/is-it-possible-to-modify-the-google-docs-sheets-right-click-context-menu

Get user-selected text

岁酱吖の 提交于 2019-12-12 07:38:43
问题 I want to select words or lines by mouse in a Google Doc, and by script, get these selected words or lines. Example: var doc = DocumentApp.getActiveDocument(); var docText = doc.editAsText(); var text = docText.getSelection(); I tried, but I didn't find any methods for selection access like in VBA. 回答1: The ability to work with cursor position and selected text was added yesterday, addressing Issue 2865: Get current user location & state information in Document. See the blog post as well. It

importxml in google docs and returning a google search result

两盒软妹~` 提交于 2019-12-12 05:39:27
问题 I am trying to upload a result of a google search into my google docs using importxml and the code that used to work doesn't anymore. I have =IMPORTXML("https://www.google.com/search?q=site: [query]&num=100&start=1","//cite") My error message is Could not fetch url: https://www.google.com/search?q=site:[query]&num=100&start=1 Can someone tell me why this doesn't work anymore? 回答1: Google has lately been blocking search requests made from both Apps Scripts and Google Sheets though the requests

Writing spreadsheet function via code

坚强是说给别人听的谎言 提交于 2019-12-12 05:29:55
问题 I want to write this into the range B1.. =split(A1," ") (the delimiter is a space) How do I do it using code? I tried this... var splitCell = "=SPLIT(A1," ")"; SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1").getRange("B1").setFormula(splitCell); But the quotes are obviously ruinous. Therefore how are quotes handled in such instances? EDIT Sorry. Brain-fart. var splitCell = '=SPLIT(A8," ")'; I thought that I had already tried that (about a million times) but when I just tried it

GoogleAPI/JSON: Retrieving data from spreadsheet?

白昼怎懂夜的黑 提交于 2019-12-12 05:29:25
问题 It turns out that I came up with my own solution: var data = {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$gs":"http://schemas.google.com/spreadsheets/2006","xmlns$batch":"http://schemas.google.com/gdata/batch","id":{"$t":"https://spreadsheets.google.com/feeds/cells/0ArzGbN1Jn061dFdJZ29VcWttZExoRXQ5TnZVX29xUlE/od6/public/basic"},"updated":{"$t":"2012-10-11T21:56:33.189Z"},"category":[{

Need to highlight and copy text from google doc viewer to clipboard

醉酒当歌 提交于 2019-12-12 05:24:57
问题 I have to create a process where a document is shown to the user and the user can highlight text and copy (and eventually paste) the text from some portions of the document. I am using google doc viewer in an iframe (since I need a universal doc viewer that's free - although I'm open to other ideas on viewers). Google doc viewer does what I need but it seems that I don't have access to the internals of the iframe to get the highlighted contents. I've looked at many links related to triggering

Google scripts docs italicize appended text

瘦欲@ 提交于 2019-12-12 05:16:36
问题 I'm creating a report from a google spreadsheet that has a repeating pattern. I want to make the first line of each block of text italicized. the text looks like this: Re: Blah Blah Blah Blah, blah blahblahblah; blah blah blah; blahblah blah. [blah blah 10 hours at $250] And I want everything from the Re: to the \n to be italicized. This pattern repeats throughout the document. Here's what I currently have: var bodyText = body.editAsText(); var stuff = ""; for (i=0; i<ParNormal.length; i++){

how to Integrate google docs with alfresco community 4.0?

旧街凉风 提交于 2019-12-12 05:15:57
问题 I found some configuration for enable google docs These properties I have added in alfresco-global.properties googledocs.googleeditable.enabled = true googledocs.username =*******@gmail.com googledocs.password =************* and in share-config I have added the code and added aspect <aspect name="gd:googleEditable"/> <!-- Google Docs™ integration --> <google-docs> <enabled>true</enabled> <creatable-types> <creatable type="doc">application/msword</creatable> <creatable type="xls">application

Document not found

牧云@^-^@ 提交于 2019-12-12 05:01:31
问题 I'm trying to download documents and for that working with document list api. Getging feed from https://docs.google.com/feeds/default/private/full of docuemnts and iterating over it, geting entry to download documents. Big part of the documents are downloaded fine, but there part of them that throws ResourceNotFoundException, here the trace: at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:591) at com.google.gdata.client.http.GoogleGDataRequest