I am trying to use the google.run.script function in one of my projects and it doesn't seem to be triggering the function to run.
So I made a new project and tested a simple example, copied exactly from https://developers.google.com/apps-script/guides/html/reference/run.
Code.gs
function doGet() {
return HtmlService.createHtmlOutputFromFile('Index');
}
function doSomething() {
Logger.log('I was called!');
}
Index.html
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<script>
google.script.run.doSomething();
</script>
</head>
<body>
</body>
</html>
However when I run the doGet() function then check my logs I do not see the 'I was called', and I cannot figure out how to correctly use google.run.script so I can use it in another project.