google-docs

How to find a Word in a Document and insert a url

醉酒当歌 提交于 2019-12-12 03:57:54
问题 How can I insert a hyperlink on a particular word in a google-drive document? I can find the word. After that, I want to assign a hyperlink. I used this code: doc.editAsText().findText("mot").setLinkUrl("https://developers.google.com/apps-script/class_text"); My doc is DocumentApp, and this works when done using the UI. However, the code above does not work. How can I perform this task? 回答1: With the help of the utility function below, you can do this: linkText("mot","https://developers

Client JavaScript receiving outdated values from server-side document set and fetch functions

佐手、 提交于 2019-12-12 03:56:15
问题 I wrote a Google Apps Script for a document to repeatedly set the text of a paragraph and then retrieve it. If I do this within a script file, everything works fine (see the function 'test' below): Code.gs: function include(filename) { return HtmlService.createHtmlOutputFromFile(filename).getContent(); } function test() { DocumentApp.getActiveDocument().getBody().insertParagraph(0, ""); for(var i = 0; i < 10; i++) { Logger.log("Inserting " + i); setText(i); Logger.log("Received " + getText())

How to use paging for retrieving Google docs?

五迷三道 提交于 2019-12-12 02:26:42
问题 I wand to receive google docs info with paging using Java Client Library. My code: private static final String URL_STRING = "https://docs.google.com/feeds/default/private/full/"; public List<DocumentListEntry> getAllDocs() throws Exception { URL feedUri = new URL(URL_STRING); DocumentQuery query = new DocumentQuery(feedUri); query.setMaxResults(2); query.setStartIndex(1); DocumentListFeed feed = client.getFeed(query, DocumentListFeed.class); return feed.getEntries(); } And processing entries:

1)Is there a Google Appscript command that can convert a .gDraw to a .jpg? 2)Can a trigger be set to perform this conversion on .gdraw file edit?

ぃ、小莉子 提交于 2019-12-12 02:00:12
问题 1)Is there a Google appscript command that can convert a .gDraw to a .jpg? 2)Can a Google trigger be set to perform this conversion on a .gdraw file edit? 1) My answer so far (in google/pseudo code) function gDrawTO_jpeg(){ var gDrawFile = DriveApp.getFilesByID('gDraw_fileID') gDrawJpg = gDrawFile.getAs("image/jpg") // doesn't work due to current getAs() limits. gDrawPdf = gDrawFile.getAs("application/pdf");} //doesn't work due to known glitch, link below Glitch in converting file to pdf on

How to create an array (or one long string) of hyperlinks in google docs using google script

拥有回忆 提交于 2019-12-12 01:13:16
问题 Or how hyperlink of google docs looks like in raw format. I tried to do the next thing: var links; var nameArr = ["1", "2", "3", "4", "5", "6"]; var tempArr= ["11", "12", "13", "14", "15", "16"]; for (i = 0; i < nameArr.length; i++) { nameArr[i].setUrlLink("https://en.wikipedia.org/wiki/" + tempArr[i] + "/detection" links = links + ", "+ nameArr[i]; } I get an error, as i can't use setLinkUrl on string, only on text object - didn't find a way to cast string into text. Although, if i paste it

auto find and replace in Google Docs App Script

孤人 提交于 2019-12-12 01:04:42
问题 I'm trying to create a note-taking template/script for Google Docs (docs, not spreadsheets) that automatically converts abbreviations into full words/phrases (ex. typing 'mgmt' automatically turns into 'management'). I can't figure out how have this happen in real-time (vs. running the script after typing is done, which would basically be a quicker find and replace). Any tips? Or is this even possible? Thank you! 回答1: If you look under "Tools" and click "Preferences", that would be what you

Splitting a 2D array using some() , by date, avoiding duplicates. Just want 1 unique email, not row. Where am i wrong here?

百般思念 提交于 2019-12-11 23:55:44
问题 So title might seem a bit confusing, it might be as I'm confusing myself. I'm new to Javascript and learning it in order to use Google Spreadsheets better. I've tried to write a script that will look at a Form responses sheet + a target sheet. Target sheet will give script a date. Script will analyse data on Form responses based on that date. End goal is to produce a report. At the moment I'm stuck on this. I can return the right amount of entries for that date. But it returns the whole row.

Edit on Google Docs without converting

放肆的年华 提交于 2019-12-11 23:28:04
问题 I'm integrating my system with Google Drive. Everything is working so far, but one thing. I cannot edit the uploaded Word documents without converting them to Google Docs first. I've read here it's possible using a Chrome plugin: https://support.google.com/docs/answer/6055139?hl=en But that's not my goal. I'm storing the file's information on my database and then I just request the proper URL for editing and previewing. Previewing is working fine, but when I try the edit URL it says the file

How can I force PHP's fopen() to return the current version of a web page?

倖福魔咒の 提交于 2019-12-11 19:38:38
问题 The current content of this google docs page is: alt text http://www.deviantsart.com/upload/i9k01q.png However, when reading this page with the following PHP fopen() script, I get an older, cached version: (source: deviantsart.com) I've tried two solutions proposed in this question (a random attribute and using POST) and I also tried clearstatcache() but I always get the cached version of the web page. What do I have to change in the following script so that fopen() returns the current

Using Zend GData, How do i get a worksheet cell index by looking for its value?

两盒软妹~` 提交于 2019-12-11 19:32:20
问题 suppose i have a cell in a worksheet that has a value of "last data cell" is this the correct way to get the index of this cell (i.e A5) using Zend GData ? $query = new Zend_Gdata_Spreadsheets_CellQuery(); $query->setSpreadsheetKey($this->_spreadsheetKey); $query->setWorksheetId($worksheet); $cellFeed = $this->_spreadsheetService->getCellFeed($query); foreach($cellFeed as $cellEntry) { $row = $cellEntry->getCell()->getRow(); $col = $cellEntry->getCell()->getColumn(); $val = $cellEntry-