I run my GAS as an Apps-script-gadget on my web-page and use the GUI-builder. I have two questions:
1.
I know how to set text in a textbox:
app.getElementById(“TextBox1”).setText(“BigSister”);
But how do i get text from a textbox?
I tried:
app.getElementById(“TextBox1”).getText();
…getValue();
…value;
etc.
Nothing works…
2.
Is it possible to print a message window from the code to the screen f.Ex. for debugging purposes?
Any advice would be appreciated.
EDIT here is a workin example for you to test
online test
and the script + GUI is here
=======================
Srik answer is absolutely right – as usual 😉 – but to make things a bit more clear to you since you are using GUI builder here is a small screen capture that shows the relevant parameters.
As for your second question, the simplest thing to do to get a momentary showing window to ‘print’ some data to screen is to use a texBox or a textAreal (or anything else that allows to show text…) and play with the
setVisible(true)&setVisible(false)to show/hide the widget. In the GUI builder you can put it anywhere in your UI, even over other elements that you normally use since it will be invisible most of the time (the visibility parameter is available in the GUI builder environment as well). It will behave exactly as a ‘popup’ in other environments…