Call a function from a button EventTrigger script

Is there a way to call a plugin function from a script associated to a button EventTrigger?

If there is/were, that would be a perfect solution to what I was asking about here: Macros/procedures/functions

Can you put the code from the function as an attribute in onChangeRequest in your plugin? Then if you must call it in a script, you can do :
App.SetDeviceAttribute("attributeName","value");
and
App.GetDeviceAttribute("attributeName");

Greg, I am doing something similar, I am using the SwitchTile as button to launch the code, so yes, the code will be inside the plugin’s onChangeRequest. Many thanks!