google-docs

apps script findText for docs

无人久伴 提交于 2019-12-06 04:32:06
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 regexer.com with a similar code block. However, running the code below on my doc is returning a null

Remove row of table in a Google Document with Google Apps Script

北城以北 提交于 2019-12-06 04:12:47
I'm trying to create documents massively using information from a spreadsheet to Google using Google Apps Script, but I don't know how to use the Table class (specifically the method: RemoveRow) I created an example (less complex) in order to illustrate my problem. I have a Google document called " Sales Reports ", this document read information from this Google Sheets called Data . So far no problem, I can do it. However, there are a condition. The product A and product B are exclusive, that is: if I buy "product A" then, I do not buy the "product B" and vice versa. The Google Docs must show

Google Multiple Sign-ins - Is there a way to specify the account in the URL?

我只是一个虾纸丫 提交于 2019-12-06 03:52:17
问题 We recently switched our team to Google Apps and with that, everyone got a Google Apps account . However, for those of us with a GMail account as well, this makes it so that bringing up Gmail in your browser opens up either your personal account or your Google apps account. Even though GMail has multiple Sign-ins enabled for both of my accounts, I still have to spend time switching through both accounts. I was wondering if there was a way to specify the account I wanted to use in the URL

Hide rows in google spreadsheet if Column A is empty?

懵懂的女人 提交于 2019-12-06 02:12:11
问题 I'm trying to hide rows if Column A is empty. I want to apply this to specific sheets (Week1, Week2, Week3, Week4 and Week5). This is the code I have so far for Week1. function ConditionalHideRow() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName("Week1"); var condition = sheet.getRange("A:A").getValue(); if (condition = "EMPTY") { sheet.hideRows(1,125) } EDIT: Bonus question, is there a way I can get it to unhide when Column A is filled? I'm using a =query

Accept Arbitrary Number of Arguments in Google Scripts Custom Function?

回眸只為那壹抹淺笑 提交于 2019-12-06 01:52:11
问题 I'm trying to re-build COUNTIFS as a Google Scripts Custom Function and having trouble with one thing: how do I build a function that accepts an arbitrary number of arguments? If you use COUNTIFS in google sheets, the inputs look like this: =COUNTIFS(criteria_range1, criterion1, [criteria_range2, criterion2, ...]) My Google Script can be this: function COUNTIFS(criteria_range1, criterion1){ // CountIFS code } ...but how do I get the optional arguments in my function? 回答1: You can reference

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

こ雲淡風輕ζ 提交于 2019-12-05 22:11:12
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 . It's a bit round the houses, but you could: Create a test project include the older version of your library Use the

How to import multiple csv files (of identical format) and create charts automatically in a Google Spreadsheet?

自作多情 提交于 2019-12-05 21:37:43
I have about 25 csv files, all of the same format (identical number of rows and columns). I would like to import these into separate sheets (tabs) of a google docs spreadsheet, and create charts (about 10) in each of the sheets. Is there a convenient script or some automatic way of populating the spreadsheet, given the format and chart templates for one sheet? One solution is to (a) import one csv file into a sheet, (b) create all the charts in the sheet, (c) make several copies of the sheet, which also creates the charts in each copy, and (d) import the remaining csv files into the other

edit google document remotely

与世无争的帅哥 提交于 2019-12-05 20:55:10
I'm trying to add a feature to my website as follows: Clicking a button appends text to a Google document. Obviously I will need to create an Apps Script in the drive. The question is how to trigger the Apps Script from my website. You can assume that I am the owner of the drive/document and so have permissions to edit it in any way I like. I have looked at these topics: Workarounds : How to edit native google documents programatcally?item How to programmatically manipulate native google doc files It seems they are all actions performed from the drive itself and not triggered remotely. I have

Showing document from Google Docs in a WebView

主宰稳场 提交于 2019-12-05 18:48:34
问题 Problem with showing google docs in WebView (Android) this is my code mWebView=(WebView)findViewById(R.id.web); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.loadUrl("https://docs.google.com/viewer?url="+ "https://docs.google.com/file/d/0B7pKTkDz8c3gWGNRTWJidTBTVmc/edit?usp=sharing"); when i click here my android shows options to open the link (like Browser, Chrome, Drive, Internet) and opens the link well in popup Browser! 回答1: How To Force Android WebView to Process Redirects

How to get Google docs last edit date

别等时光非礼了梦想. 提交于 2019-12-05 17:23:22
问题 I am working on an app in which I need to show the date when google doc was last edited. Snapshot Here I am able to get last modified date through Drive api But it is different from last edited date for cases when file's metadata (e.g. permission) has changed and content hasn't. Is there any way to get date when google doc was last edited? 回答1: In Google Apps Script there is a DriveApp service that you can use. Something like this will work: function lastUpdatedOn() { var FILE_ID = 'FILEID';