google-docs

Getting a list of active file viewers with apps script

穿精又带淫゛_ 提交于 2019-12-17 21:14:03
问题 I've been googling for a while but have come up with no results that tell me I can't, but no results telling me I can. What I'm looking for is a way in apps script (or anything in their .NET/Java/Python...API) to give me a list of people who are actively looking at the sheet when I ask. I tried getViewers but it gives me a list of all people with access, not the ones looking at it currently. If I wanted to do some data manipulation but didn't want to do it when people where in the file, or if

Remove sign in button in google docs webview in android

坚强是说给别人听的谎言 提交于 2019-12-17 21:02:57
问题 I am showing PDF files by using google docs in WebView in android. How to remove or hide "Sign In" button? I have attached screenshot below. Thanks in advance. webview = (WebView) findViewById(R.id.webView1); webview.getSettings().setJavaScriptEnabled(true); webview.loadUrl("https://docs.google.com/viewer?url=http://www.ex.com/terms.pdf"); webview.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return

Delete a row in google spreadsheet base on contents of cell in row

Deadly 提交于 2019-12-17 20:30:45
问题 i have this script to delete certain rows, if the selected cell in the selected colum has the metioned content but i don't understand where it fails function DeleteRowByKeyword() { var value_to_check = Browser.inputBox("Enter the keyword to trigger delete Row","", Browser.Buttons.OK); // prendo quello attivo var DATA_SHEET = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var FIRST_COLUMN = Browser.inputBox("Number of Column to look at (eg: for column A enter 1)","", Browser.Buttons

insert image at specific point of paragraph

笑着哭i 提交于 2019-12-17 18:59:07
问题 *I have a Google Document with a string like "text {logo} text" How do place an image where {logo} is? So far I tried: var logoElement = s.findText("{logo}").getElement(); logoElement.getParent().insertInlineImage(0,logoBlob); s.replaceText("{logo}", ""); But this inserts the image before the found paragraph (or with 1: after ). How do I place it inside the paragraph at the exact location? 回答1: I hope will be helpful, The following code is fine to me. function insertImage(doc) { // Retrieve

Exported PDF is blank if merge and export functions are run from the same Apps Script function

回眸只為那壹抹淺笑 提交于 2019-12-17 17:16:26
问题 I have code that combines several Google Docs into one file, and code to save a Doc as PDF: function createPDF(docId) { var docFile = DriveApp.getFileById(docId); var blob = docFile.getAs('application/pdf'); var file = DriveApp.createFile(blob); file.setName('test.pdf'); } function mergeDocuments(doc, docIDs){ var body = doc.getActiveSection(); for (var i = 0; i < docIDs.length; ++i ) { var otherBody = DocumentApp.openById(docIDs[i]).getActiveSection(); var totalElements = otherBody

Convert Google Doc to PDF using Google Script Editior

≯℡__Kan透↙ 提交于 2019-12-17 16:21:39
问题 I've been trying to convert a Google Docs file to a PDF file without having to use the download option. Below is the script I have used in the Script Editor but it doesn't seem to work. I think the error is after the IF statement. function convertPDF() { doc = DocumentApp.getActiveDocument(); docblob = DocumentApp.getActiveDocument().getAs('application/pdf'); var result = DocumentApp.getUi().alert( 'Save As PDF?', 'Save current document (Name:'+doc.getName()+') as PDF', DocumentApp.getUi()

How do you create a document in Google Docs programmatically?

自作多情 提交于 2019-12-17 08:48:09
问题 The documentation for Google Documents List API, seems to say that you can create a local document and upload it. Is there no way to actually create and edit a document on Google Docs through an API? 回答1: While the docs call it "uploading", everything boils down to sending an appropriately formatted HTTP POST request, so of course it can actually be a new creation rather than an actual "upload" of an otherwise existing file. (Creation through POST requests is similar to what's normally

How to convert a Google Docs-File to an Excel-File (XLSX)

你离开我真会死。 提交于 2019-12-17 06:49:16
问题 The image shows the code who is updated. The var "xlsFile" is undefined, why? How can I convert the Googledocs-File to an Excel-File with (GoogleDocs) ScriptEditor function googleOAuth_ (name, scope) { var oAuthConfig = UrlFetchApp.addOAuthService(name); oAuthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken? scope="+scope); oAuthConfig.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken"); oAuthConfig.setAccessTokenUrl("https://www.google

Creating anchored comments programmatically in Google Docs

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 04:31:13
问题 I have been unable to programmatically create a comment that is anchored to specific text in a Google Doc using an app script with the document. Google documentation about how to create an anchored comment using the Google Drive API: https://developers.google.com/drive/web/manage-comments Here is the code I have to create the comment in the doc: Drive.Comments.insert({ "kind": "drive#comment", "author": { "kind": "drive#user", "displayName": USER_EMAIL, "isAuthenticatedUser": true, },

Google Spreadsheet, finding the previous weekday

筅森魡賤 提交于 2019-12-14 02:42:49
问题 In Google Spreadsheet, or excel if its the same, how do I find the last weekday of day D only if D is not a weekday itself. I.E: If D equals weekday = do nothing (D equals D). If D equals weekend = D equals last weekday. Edit: i tried this to get the workday one month away: WORKDAY(EDATE(N18, 1)+1, -1) But I Was getting some weird results. Perhaps it counts red days as well, but I never specified the region anywhere. Edit again: This above example actually works, eg: =WORKDAY("2013-04-06"+1,