# Scripting a button

**URL:** <https://forum.inductiveautomation.com/t/scripting-a-button/92688>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 2, 2024, 2:52pm UTC](https://forum.inductiveautomation.com/t/scripting-a-button/92688 "2024-07-02T14:52:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mitchell\_Gerber](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Mitchell\_Gerber](https://forum.inductiveautomation.com/u/Mitchell_Gerber)\
**Post date:** [July 2, 2024, 2:52pm UTC](https://forum.inductiveautomation.com/t/scripting-a-button/92688/1 "2024-07-02T14:52:03Z")

</div>

I am trying to script a button to write a 1 into a tag when pressed and when release write a 0. Do I need to script this? If so what is the best route? If a script is not needed what is a common solution?

Thanks!

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 2, 2024, 2:58pm UTC](https://forum.inductiveautomation.com/t/scripting-a-button/92688/2 "2024-07-02T14:58:49Z")

</div>

The general consensus is: Don't do it.  
Do a quick search of "momentary button" on the forum to find out why.
