I have an auto sort script on a Sheets document that I will be giving multiple people editing permission to, to add to the file. I have created a trigger so the script also runs when other users edit the file as well.

The only thing I would like to do now is prevent other users with editing permission from accessing the script editor and changing it. Is it possible to prevent access to script editor for other collaborators with editing permission?

I have read other answers saying to create a standalone script and programmatically create an installable trigger. I have created a standalone script but I don't know how to use it with the Sheets document and when I tried to put in an installable trigger it only seemed to run the script properly once, and when accessing it from another users account I could still access script editor as well.

2 Answers 2


I see this question is quite old but thought I'd answer for of other searchers in the future.

You can't restrict editors from viewing the script editor.

You can, as you have started to explore, have a standalone script file which connects to the standalone spreadsheet.

In Drive click NEW > MORE > Google Apps Script

You connect the spreadsheet & the script together by using:

var ss = SpreadsheetApp.OpenFileById("[spreadsheetIdHere]")

Once the variable ss is assigned to the spreadsheet you can reference it in the standalone script the same as you would have done if it had been a bound script in the script editor.

The spreadsheet ID is the long number (marked as xxxx here) between 2 slashes for instance:


I hope that gives you something to go on.


As of writing, changing the role to commenter will hide the Tools menu and the script editor for this user.

Unfortunately, they would not be able to launch the script then and utilize the functions of it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.