Is there a way to access the widgets within a panel in GAS?
Something like:
function clickHandler_(e) {
var app = UiApp.getActiveApplication();
var panel = app.getElementById(e.parameter.whatever); // short-cutting here
for (var i=0; i<panel.widgets.length; i++) {
var widget = panel.widgets[i];
// do something with them
}
return app;
}
There isn’t something simple like this.
You have to give all widgets an id when adding them and save them somewhere so you can retrieve it later. For example, as a tag on the panel:
By the way, you probably know that, but your code had a mistake:
It’s not
UiApp.getElementById, butapp.getElementById.