I have read the following threads:
- Scripts not working for anonymous users, Google spreadsheet
- Google Spreadsheet GAS Trigger not firing for anonymous editors
I have a very simple bound script that will add a menu item under the Add-ons menu. From what I've gathered, this is possible regardless of the users authMode and your way of publishing your script.
function onOpen(e) {
var menu = SpreadsheetApp.getUi().createAddonMenu();
menu.addItem('Alert', 'alert');
menu.addToUi();
}
function alert() {
SpreadsheetApp.getUi().alert('alerted');
}
This works for all logged in users, but not for anonymous users. When opening the sheet as an anonymous user, the menu option isn't even there. As suggested in the second post above, I have also created a installable trigger for my onOpen function, but it still doesn't work. A installable trigger should run as the user who created the script, and I have authorized it.
I also have shared the link as "Everyone with the link can edit". Have I misinterpreted something? It feels like this shouldn't be a big hassle.
Any help would be greatly appreciated. If you need any more information to help, please tell me and I will provide it.