google-apps-script

How to force the termination of a Google Apps Script

偶尔善良 提交于 2021-01-29 09:17:24
问题 Something went wrong on one of my last debug session with Google Apps Script (don't know what). Since then, I'm not able to run a debugger anymore. The debugger refuses to start. When i checked the Execution Report/page I noticed all my debugging sessions are still running. I tried to terminate them by selecting the 3-dots menu on the right and the Terminate command (for every single process). Apparently the process/execution was terminated, I even received a confirmation: But, as I refresh

Clear content in S:S when T:T contains “Copied” Google Script

天大地大妈咪最大 提交于 2021-01-29 09:12:03
问题 I am stuck with, at first sight, simple script. I want to clear a content from cell S when T has value "Copied". What I have at the moment is this: function onEdit(e) { if(e.range.columnStart === 20) { e.range.offset(0,-1).clearContent(); } } I am not sure how to include IF. Also, bear in mind that T column has a formula, so I don't edit it manually, and with this script, it doesn't work. It doesn't have to be OnEdit, I can set a trigger to run the script every minute which is even better,

Running script for multiple search terms found on different sheet

我的梦境 提交于 2021-01-29 09:01:13
问题 I'm trying to get a SCORESHEET to populate from a REPORTSHEET , using a REFERENCESHEET to collate search terms and destination cells. The script I'm running is as below. The idea is that the script finds searchDate 's in the REFERENCESHEET and uses them to locate data columns in the REPORTSHEET : function superAuto() { var report = SpreadsheetApp.openById('REPORTSHEET'); var reportData = report.getDataRange().getValues(); var reference = SpreadsheetApp.openById('REFERENCESHEET'); var

Paste the values for each column until the today's date google apps scripts

廉价感情. 提交于 2021-01-29 08:55:24
问题 I've this table, with some information that are link with other tables, almost all the rows have formulas (you can find on the picture). I update the information on the other tabs and with the formulas, the values and information are pasted in the rows, but I update day by day, so I need to copy/paste the values until the today's day inside this tabs instead of select the columns, and paste values. Like is shown on the picture, from day July 2nd (column) I've the formulas, and the days before

Getting my current position from my phone with script in Google spreadsheet

心不动则不痛 提交于 2021-01-29 08:42:56
问题 Is there a way to get my current position (latitudes and longitudes, preferably in decimal form) from my phone's GPS data with a Google Apps Script? Also, is it possible to turn GPS on and off or at least detect if it's on or off? Here's what I try to do: I go to places with my electric moped, and at every place I enter some data in a spreadsheet, such as date, distance since last position, which battery I'm using and more. One of the columns is my position. I currently enter it manually, but

Need help, spreadsheet formula not refreshed in exported PDF

江枫思渺然 提交于 2021-01-29 08:41:10
问题 I have a Google sheet that is exported as PDF and emailed using App Script but there are a few cases where the PDF shows #NAME? in cells where I used a custom function. But in most cases it is fully displayed. Is there a way around this? It looks like before the sheet has fully refreshed, it is already exported into PDF. If I manually open the spreadsheet, it shows the figures but sometimes it refreshes and takes about 2 to 3 seconds to redisplay the values. Here is how it looks like: My code

Googlesheet script to copy range only if it is not empty or error

南楼画角 提交于 2021-01-29 08:31:28
问题 I'm trying to copy certain range from other sheet (or the same one) but only copy it if the range is not empty or have an error message like (#N/A, #REF, etc.). For example: Sheet 1: Contains the original data sheet. Sheet 2: Contains the copied data from the script, but the data here only overwritten if the original ones are not empty or errored. function test() { SpreadsheetApp.getActive().getSheetByName('sheet2').getRange('A2').setValue('=QUERY(sheet1!A2:E355, "SELECT A, B, C, D, E LIMIT

Google script HTML select required did not work

感情迁移 提交于 2021-01-29 08:21:56
问题 Code (I'm working with Materialize CSS framework): <form class="col s12" id="formRequer"> <div class="input-field col s6"> <select id="stdApply" name="stdApply" required> <option value="" disabled selected>Escolha somente uma das opções</option> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> </select> <label>Selecione o que quer requerer</label> </div> </form> <!-- END: form class="col s12" id="formRequer --> <button class="btn

Attach multiple files - Google Sheets/Gmail/Drive

▼魔方 西西 提交于 2021-01-29 08:19:27
问题 I currently have a script to create draft emails and also attach a file to them. Currently, the script does not work for multiple file attachments and also does not work if there are no attachments. Any tips on how to get (1) and (2) [below] Updated for more info: Main objective is to add a multiple file names in Col[3] and attaching the files to the draft using the files names provided in Col[3]. Example: if I type the following into Col[3]: "test.pdf, test2.pdf" it will attach the files

How to reduce the latency between two script calls in Google Apps Script

一曲冷凌霜 提交于 2021-01-29 08:06:24
问题 In a self-developed add-on for Google Sheets, the functionality has been added that a sound file will be played from a JavaScript audio player in the sidebar, depending on the selection in the table. For the code itself see here. When a line is selected in the table the corresponding sound file is played in the sidebar. Every time the next line is selected it takes around 2 seconds before the script will start to run and load the sound file into the sidebar. As the basic idea of the script is