I have been searching high and low and can not find a concrete answer. Some questions say yes others say no. In the case, I have a script I want to run that creates a custom menu/menu item that runs another script. I have this installed as an installable trigger set to run onOpen. This works marvelously for me or anyone else logged into google. Using incognito or not being logged in not so much. I have also attempted doing this via web app publishing using the "execute the app as" "Me" and "who has access to the app" "Anyone, even anonymous". This again works great for me and anyone logged in not so much for incognito or people not logged in. I am pretty much at the end of my rope trying to make heads or tails of this.
/*
Global
*/
var width = 1000;
var height = 700;
/**
* Creates a trigger for when a spreadsheet opens.
*/
function createSpreadsheetOpenTrigger() {
var ss = SpreadsheetApp.getActive();
ScriptApp.newTrigger('onOpen')
.forSpreadsheet(ss)
.onOpen()
.create();
}
function onOpen() {
SpreadsheetApp.getUi().createMenu('Freight Form').addItem('Freight Form', 'freight').addToUi();
}
function freight(){
var hs = HtmlService.createTemplateFromFile('ModalDialog');
hs.width = width;
hs.height = height;
hs.publishedUrl = SpreadsheetApp.openById("spreadsheetID*").getFormUrl();https://docs.google.com/forms/d/e/spreadsheetID*/viewform?usp=sf_link
var userInterface = hs.evaluate()
.setWidth(width)
.setHeight(height);
SpreadsheetApp.getUi().showModalDialog(userInterface, 'Form');
}
function getSize(type){
if(type === 'width')
return width - 20;
if(type === 'height')
return height - 20;
return 600;
}