google-apps-script

Get the IDs of the files in different folders

陌路散爱 提交于 2020-11-29 23:51:20
问题 This is a follow-up question for this thread. Is there a way for me to get the IDs of the file in a different folder? Below is the directory of what I'm working on. And this is the code that I'm using. function myFunction() { const ss = SpreadsheetApp.getActive(); var SSID = ss.getId(); //sheet id var spreadsheetFile = DriveApp.getFileById(SSID); var folderId = spreadsheetFile.getParents().next().getId(); const sh = ss.getSheetByName('Sheet4'); // change that to the name of your sheet const

Get the IDs of the files in different folders

痴心易碎 提交于 2020-11-29 23:49:54
问题 This is a follow-up question for this thread. Is there a way for me to get the IDs of the file in a different folder? Below is the directory of what I'm working on. And this is the code that I'm using. function myFunction() { const ss = SpreadsheetApp.getActive(); var SSID = ss.getId(); //sheet id var spreadsheetFile = DriveApp.getFileById(SSID); var folderId = spreadsheetFile.getParents().next().getId(); const sh = ss.getSheetByName('Sheet4'); // change that to the name of your sheet const

what are the google APIs to manage policies to block/restrict add-in(s) in google/Gsuite

梦想的初衷 提交于 2020-11-29 21:27:22
问题 I have a requirement to block/restrict specific add-ins for user(s) in accessing. I could able to block add-ins using google admin portal ( Security -> API Control), which solves the problem but instead of doing this manually, I would like to automate the same using google APIs. I tried to explore users, tokens, etc APIs but could not find an option. Appreciate if you can suggest an option to achieve this functionality through API. Providing more details for better understanding: To get the

what are the google APIs to manage policies to block/restrict add-in(s) in google/Gsuite

半世苍凉 提交于 2020-11-29 21:09:01
问题 I have a requirement to block/restrict specific add-ins for user(s) in accessing. I could able to block add-ins using google admin portal ( Security -> API Control), which solves the problem but instead of doing this manually, I would like to automate the same using google APIs. I tried to explore users, tokens, etc APIs but could not find an option. Appreciate if you can suggest an option to achieve this functionality through API. Providing more details for better understanding: To get the

Hiding tabs/sheets in Google Spreadsheet from certain users

别说谁变了你拦得住时间么 提交于 2020-11-29 10:49:20
问题 I am aware of the protect sheet/range function in google spreadsheet but what I want to do is to hide sheets completely from certain users. I have found an answer to this with the code below. I am able to hide certain tabs/sheets to the specified user automatically upon opening the spreadsheet but that doesn't stop them from unhiding the tabs/sheets again. Any recommendations to restrict them from unhiding those tabs? function onOpen() { var adminUsers = ['sample@google.com']; var Users = [

Google Sheet: Generate a PDF file within a named range and sent it to email

女生的网名这么多〃 提交于 2020-11-29 10:35:53
问题 I'm trying to send a PDF file via email. I saw a code here on how to send an email and it kinda works, but it generates all the visible sheets (hidden sheet is not included) in the PDF file. I already modified it to generate the active sheet but all the data on that sheet is still visible. I have a named range and it's called "print_area_1". Is it possible if I only want to show the "print_area_1" part on the PDF file? Here's my modified code for it. function sendSheetToPdfwithA1MailAdress(){

splitting up text with a regular expression in google app script (documentApp) with findText

佐手、 提交于 2020-11-29 10:34:35
问题 In a google doc (not a spreadsheet) I have a wall of text that looks like °foo bar header°foo bar bat paragraph°and another paragraph°and yet an other paragraph°and so on and I want to split up the text into paragraphs. So I would like to get the text between the ° chars with help of a regexp. I would like to use var rangeElement = body.findText("°([^°]*)°"); but that regexp makes google docs go "Service unavailable: Docs". Using a regexp like "°.?°" alleviates that problem, but does not

How to use Google Photos API Method: mediaItems.search in Google apps script for a spreadsheet

雨燕双飞 提交于 2020-11-29 09:04:27
问题 I really tried to figure this out on my own... I am trying to load photo metadata from google photos into a sheet using the Google Photos API and google apps script. I was able to make some progress after a lot of help on a previous question Is it possible to load google photos metadata into google sheets? I now have two functions. function photoAPI_ListPhotos() - Uses Method: mediaItems.list and gives me all my photos that are not archived function photoAPI_ListAlbums() - Uses Method: albums

How to use Google Photos API Method: mediaItems.search in Google apps script for a spreadsheet

丶灬走出姿态 提交于 2020-11-29 09:02:13
问题 I really tried to figure this out on my own... I am trying to load photo metadata from google photos into a sheet using the Google Photos API and google apps script. I was able to make some progress after a lot of help on a previous question Is it possible to load google photos metadata into google sheets? I now have two functions. function photoAPI_ListPhotos() - Uses Method: mediaItems.list and gives me all my photos that are not archived function photoAPI_ListAlbums() - Uses Method: albums

How to allow a google apps script to be executed in the pubhtml version? [closed]

余生长醉 提交于 2020-11-29 04:06:11
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 months ago . Improve this question To give context. I have recently made a Character Sheet, with the gimmick being that they randomly change form. I have made a script that allows one to click a button and a new form will be randomly generated from a hidden sheet. Now, I wanted to publish it so that the group