# How to run script on gateway

**URL:** <https://forum.inductiveautomation.com/t/how-to-run-script-on-gateway/19496>\
**Category:** Ignition\
**Created:** [August 31, 2018, 7:26pm UTC](https://forum.inductiveautomation.com/t/how-to-run-script-on-gateway/19496 "2018-08-31T19:26:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amdnol](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@amdnol](https://forum.inductiveautomation.com/u/amdnol)\
**Post date:** [August 31, 2018, 7:26pm UTC](https://forum.inductiveautomation.com/t/how-to-run-script-on-gateway/19496/1 "2018-08-31T19:26:45Z")

</div>

Hi!  
How can I run a script on gateway when I click on a button?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 31, 2018, 7:36pm UTC](https://forum.inductiveautomation.com/t/how-to-run-script-on-gateway/19496/2 "2018-08-31T19:36:46Z")

</div>

You could:

1. write to a tag that has a tag change script on it, which will run in gateway scope.
2. use a message handler and `system.util.sendMessage` or `system.util.sendRequest`:  
[https://docs.inductiveautomation.com/display/DOC79/system.util.sendMessage](https://docs.inductiveautomation.com/display/DOC79/system.util.sendMessage)  
[https://docs.inductiveautomation.com/display/DOC79/system.util.sendRequest](https://docs.inductiveautomation.com/display/DOC79/system.util.sendRequest)
