Google Apps Scripts to enable/disable comments based on the current list of viewers.
To add the comment code to a Google Doc, perform the following actions.
- Select the "Tools/Script Editor" menu item to open the Script Editor.
- Select the "File/New/Script file" menu item to create a new script file.
- Enter "main" as the new file name.
- Replace the contents of the editor window with the contents of the "main.gs" file here.
- Repeat steps 2-4 for the "local.gs" script file.
- Select the drop-down menu of the "Code.gs" script file and select "Delete" to remove it.
- Select the "File/Save all" menu item to save the new script files.
- Select the name of the script project and rename it to "Access".
- Switch back to the main Google Doc file and reload the page.
To enable comments on the Google Doc, select the "Add-ons/Access/Enable Commenting" menu item. To disable comments on the Google Doc, select the "Add-ons/Access/Disable Commenting" menu item.
The first time it is run, authorization is required.
- Select "Continue".
- Sign-in to your Google Account, if necessary.
- Select "Advanced".
- Select "Go to Access".
- Select "Allow".