# Perspective: Scripting a Momentary Button

**URL:** <https://forum.inductiveautomation.com/t/perspective-scripting-a-momentary-button/35684>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [June 15, 2020, 11:32pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-a-momentary-button/35684 "2020-06-15T23:32:09Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![aspatchek2013](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/aspatchek2013/32/85339_2.png) [@aspatchek2013](https://forum.inductiveautomation.com/u/aspatchek2013)\
**Post date:** [April 1, 2021, 6:41pm UTC](https://forum.inductiveautomation.com/t/perspective-scripting-a-momentary-button/35684/5 "2021-04-01T18:41:33Z")

</div>

I had the same application where I could not alter the PLC code and needed a momentary script. This would write a tag on, delay 1.5 seconds, and then write it off again.

```auto
from threading import Timer

def writeOn():
    system.tag.write("[default]Testing Tags/Bool Test", 1)
def delayOff():
    system.tag.write("[default]Testing Tags/Bool Test", 0)

writeOn()
t = Timer(1.5, delayOff)
t.start()

```

Again, as stated - it is not recommended as there is no way to guarantee it gets written off again. However, it works in a pinch.

---

_[View the full topic](https://forum.inductiveautomation.com/t/perspective-scripting-a-momentary-button/35684)._
