Perspective Button onClick Action scripting

Momentary push buttons through HMIs are not recommended. This thread will lead to discussions about them:

Or just all these threads (notice all the problems they tend to have):
https://forum.inductiveautomation.com/search?q=momentary%20push%20button

However, if you have to, you could use system.tag.writeBlocking in a Button's onMouseDown and onMouseUp events. I would personally not do it this way.