google-apps-script

Google sheets: Working code for get IDs but result should be align on the filename row

邮差的信 提交于 2020-12-15 04:55:28
问题 The IDs should be aligned like the sample on the left side. But as you can see on the right side, everything is working fine until row 11. Can someone help me with this one? Here's the code that I'm using. I got it from here. function myFunction() { const ss = SpreadsheetApp.getActive(); var SSID = ss.getId(); var spreadsheetFile = DriveApp.getFileById(SSID); //get file by id //var folderId = spreadsheetFile.getParents().next().getId(); var folderId = "1vn5n00iCpKUWe_JsTFAesQsSmBsXu36i";

Working with Protected Sheets and Ranges “View Only” mode

跟風遠走 提交于 2020-12-15 04:54:15
问题 Just want to ask if there is a way for a user to use a button with a lock or unlock script even if the permission on Protected Sheets and Ranges is in " View Only " mode? Will using a web app work or it is still impossible? 回答1: Issue: A script cannot protect/unprotect a sheet or range if the user executing it doesn't have edit access to the protected sheet/range. Trying to do so this result in a message like: You are trying to edit a protected cell or object. Please contact the spreadsheet

Google Script having a conflict with scripts

一笑奈何 提交于 2020-12-15 04:19:24
问题 I'm new to this scripting thing. So, I just want to ask if why am I receiving this kind of error? So the thing is that when I first open the spreadsheet, everything looks fine. The buttons with the lock or unlock work both user and owner. But then after I clicked the hide or show button, this error shows when I clicked the lock or unlock button on the user side. The buttons are located on one sheet while the scripts are in one project file. Here's the code for the hide and show rows: function

Google Script having a conflict with scripts

血红的双手。 提交于 2020-12-15 04:16:24
问题 I'm new to this scripting thing. So, I just want to ask if why am I receiving this kind of error? So the thing is that when I first open the spreadsheet, everything looks fine. The buttons with the lock or unlock work both user and owner. But then after I clicked the hide or show button, this error shows when I clicked the lock or unlock button on the user side. The buttons are located on one sheet while the scripts are in one project file. Here's the code for the hide and show rows: function

Best method to extract selected columns from 2d array in apps script

落花浮王杯 提交于 2020-12-14 12:39:18
问题 I'm working in google apps script. If I start with a range like range A1:E5, that's a 5x5 array. I want to return range C1:D5, a 5x2 array. Start with a 2d array and return only selected 'columns'. That's basically it. I think it's a fundamental operation, but I'm really struggling. I have my code below, but I'm open to any options that use arrays (not ranges, so as to avoid pinging the server unnecessarily). Note that I do want to be able to pass an array parameter for columns, so [2,3,4] or

Best method to extract selected columns from 2d array in apps script

ぃ、小莉子 提交于 2020-12-14 12:33:25
问题 I'm working in google apps script. If I start with a range like range A1:E5, that's a 5x5 array. I want to return range C1:D5, a 5x2 array. Start with a 2d array and return only selected 'columns'. That's basically it. I think it's a fundamental operation, but I'm really struggling. I have my code below, but I'm open to any options that use arrays (not ranges, so as to avoid pinging the server unnecessarily). Note that I do want to be able to pass an array parameter for columns, so [2,3,4] or

Best method to extract selected columns from 2d array in apps script

早过忘川 提交于 2020-12-14 12:33:05
问题 I'm working in google apps script. If I start with a range like range A1:E5, that's a 5x5 array. I want to return range C1:D5, a 5x2 array. Start with a 2d array and return only selected 'columns'. That's basically it. I think it's a fundamental operation, but I'm really struggling. I have my code below, but I'm open to any options that use arrays (not ranges, so as to avoid pinging the server unnecessarily). Note that I do want to be able to pass an array parameter for columns, so [2,3,4] or

Is it possible to create a single pdf from multiple Google spreadsheets?

旧街凉风 提交于 2020-12-13 11:54:28
问题 I am able to create a pdf from a single Google spreadsheet sheet using this code. Is it possible to tweak this code to allow multiple sheets from different spreadsheets to be merged into a single pdf? Or would I need to take an entirely different approach? 回答1: I guess you can't but you can easily merge spreadsheets into a temporary spreadsheet and export this one as pdf. to merge sheets from different origins you have a choice of methods to choose from, below is a small example that gets 1

Is it possible to create a single pdf from multiple Google spreadsheets?

拥有回忆 提交于 2020-12-13 11:53:29
问题 I am able to create a pdf from a single Google spreadsheet sheet using this code. Is it possible to tweak this code to allow multiple sheets from different spreadsheets to be merged into a single pdf? Or would I need to take an entirely different approach? 回答1: I guess you can't but you can easily merge spreadsheets into a temporary spreadsheet and export this one as pdf. to merge sheets from different origins you have a choice of methods to choose from, below is a small example that gets 1

Update value in a spreadsheet sidebar when next row is selected in table

前提是你 提交于 2020-12-13 07:06:58
问题 To facilitate the annotation of audio files in a Google spreadsheet, I'd like to implement an audio player in the sidebar which automatically plays the audio file mentioned as URL in the row of a table. After listening and entering some date in this row, I'd like to move to the next row and do the same. Thus, the URL to the audio file should be updated whenever I select a new row and the whole process should be fast, too, in order to listen quickly to one sound file after the other. I've