Created
November 5, 2024 09:48
-
-
Save sinabakh/b3e75f4c5ef39a8bffe505af8ff7c2e2 to your computer and use it in GitHub Desktop.
Share Google Slides & Sheets with a list of Gmails in a Google Sheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sharing Sheets | |
// In the Google Sheet, click on Extensions > Apps Script. | |
function shareSheet() { | |
const sheet = SpreadsheetApp.getActiveSpreadsheet(); | |
const emailsSheet = SpreadsheetApp.openById("YOUR_SPREADSHEET_ID"); // Link to your Google Sheets file with emails | |
const emails = emailsSheet.getSheetByName("Emails").getRange("A1:A").getValues().flat(); // Change Accordingly | |
emails.forEach(email => { | |
if (email) { | |
sheet.addEditor(email); | |
} | |
}); | |
} | |
// Sharing Slides | |
// In the Google Slides, click on Extensions > Apps Script. | |
function shareSlides() { | |
const slides = SlidesApp.getActivePresentation(); // Get the active Google Slides presentation | |
const emailsSheet = SpreadsheetApp.openById("YOUR_SPREADSHEET_ID"); // Link to your Google Sheets file with emails | |
const emails = emailsSheet.getSheetByName("Emails").getRange("A1:A").getValues().flat(); | |
emails.forEach(email => { | |
if (email) { | |
slides.addEditor(email); // Share with each email as an editor | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment