0
votes

Ok, so, I have an apps script that generates a new sheet based on a template sheet in my master document and then logs the URL for each new sheet with that user in the list. Easy. Done.

Example: Last | First | Email | Sheet URL

Then, I have another script that reads a list of users to add as editors to each of those sheets created in the first script. I have used an array to first build the list of editors so that when my script executes it only needs to open the sheet once then add my array of editors, then the next sheet, then the next... Easy. Done.

Now, for the hard part. Let's say I want to REMOVE a list of users. There is an addEditors (plural) object, but there is NOT a removeEditors object. It's just removeEditor (singular). Ugh. This means that I have to iterate through a list of editors to remove and the list of documents. Meaning... I have to...

...grab a user's name, open a sheet, remove that editor, open the next sheet, remove, next, remove...

...then grab the next user to remove and start the process all over again.

My question is... Is there something I'm missing? Is there another way to pass an array into removeEditor? I can't find it and it seems like that it should already exist.

Note: I have the code to remove a user one at a time. I'm looking for a way to remove many users at once.

1

1 Answers

0
votes

Unfortunately there is no removeEditors(users) , what about converting the array of users into an array of email adresses then using the removeEditors(emailAdresses) method? It should be faster than removing users one by one.