Is it possible to 'chain' functions? Say, I have a serverclickhandler and then would like to invoke another function after it right away. How do I go about it?
Thanks.
Is it possible to 'chain' functions? Say, I have a serverclickhandler and then would like to invoke another function after it right away. How do I go about it?
Thanks.
Not sure I understood exactly your question but serverhandlers to which you refer are precisely made for that... (see doc) Note that you can assign multiple handlers to UI elements to trigger different functions and eventually chain them.
To have a second handler executed after the first one you just need to call it directly from your first handler, e.g.
I placed the
app
var on a global scope so you can get it only when necessary (sharing it between the functions without explicit passing it), saving a possibly costly and unknown behavior (to me at least) of a secondgetActiveApplication()
call.