# Does the Enable property affect Scripts assigned to a momentary button?

**URL:** <https://forum.inductiveautomation.com/t/does-the-enable-property-affect-scripts-assigned-to-a-momentary-button/67618>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [December 14, 2022, 3:40pm UTC](https://forum.inductiveautomation.com/t/does-the-enable-property-affect-scripts-assigned-to-a-momentary-button/67618 "2022-12-14T15:40:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samich777](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@Samich777](https://forum.inductiveautomation.com/u/Samich777)\
**Post date:** [December 14, 2022, 3:40pm UTC](https://forum.inductiveautomation.com/t/does-the-enable-property-affect-scripts-assigned-to-a-momentary-button/67618/1 "2022-12-14T15:40:23Z")

</div>

I have a momentary button with an if else script. I've binded a tag to the Enabled property on the button. It seems, however, that even when the button is disabled the script still runs. Is this because the script is disregarding the Enabled property of the button and does it's own thing? On other buttons I am just using the Set Property function and the Enabled property works fine.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 14, 2022, 3:42pm UTC](https://forum.inductiveautomation.com/t/does-the-enable-property-affect-scripts-assigned-to-a-momentary-button/67618/2 "2022-12-14T15:42:47Z")

</div>

An if/else script where, on which event handler?

---

<div class="post-metadata">

**Author:** ![Samich777](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@Samich777](https://forum.inductiveautomation.com/u/Samich777)\
**Post date:** [December 14, 2022, 3:43pm UTC](https://forum.inductiveautomation.com/t/does-the-enable-property-affect-scripts-assigned-to-a-momentary-button/67618/3 "2022-12-14T15:43:56Z")

</div>

mouseReleased

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 14, 2022, 3:48pm UTC](https://forum.inductiveautomation.com/t/does-the-enable-property-affect-scripts-assigned-to-a-momentary-button/67618/4 "2022-12-14T15:48:19Z")

</div>

You'll want to move your script to the `actionPerformed` event handler

---

<div class="post-metadata">

**Author:** ![Samich777](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@Samich777](https://forum.inductiveautomation.com/u/Samich777)\
**Post date:** [December 14, 2022, 3:49pm UTC](https://forum.inductiveautomation.com/t/does-the-enable-property-affect-scripts-assigned-to-a-momentary-button/67618/5 "2022-12-14T15:49:26Z")

</div>

Awesome, thanks!
