# Question About runScript

**URL:** <https://forum.inductiveautomation.com/t/question-about-runscript/85599>\
**Category:** Ignition\
**Created:** [February 12, 2024, 11:17pm UTC](https://forum.inductiveautomation.com/t/question-about-runscript/85599 "2024-02-12T23:17:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NP209](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/np209/32/80704_2.png) [@NP209](https://forum.inductiveautomation.com/u/NP209)\
**Post date:** [February 12, 2024, 11:17pm UTC](https://forum.inductiveautomation.com/t/question-about-runscript/85599/1 "2024-02-12T23:17:51Z")

</div>

Hello! I have been wanting to see if I can simply run a script on button press. I have been trying to play around with:

```auto
 runScript(scriptFunction, [pollRate], [arg1], [arg2], [arg...]) 

```

I'm trying to run a Script stored on the gateway I'm assuming. It's in the scripting section in the project browser.

The code I'm using is:

```auto
 runScript(EmailSummary)

```

But its not working. I'm getting a

```auto
com.inductiveautomation.ignition.common.script.JythonExecException
Traceback (most recent call last):
  File "<function:runAction>", line 2, in runAction
NameError: global name 'runScript' is not defined

```

Is this not supported or am i using this syntax wrong?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 12, 2024, 11:42pm UTC](https://forum.inductiveautomation.com/t/question-about-runscript/85599/2 "2024-02-12T23:42:07Z")

</div>

The `runScript()` function is for **expression bindings**. Not for event scripts. Event scripts are already in jython form--they don't need an interface to call other jython.

Next, calling `EmailSummary` is certainly not going to be correct by itself. Script library modules need to have function definitions within them to be useful, and you would call `EmailSummary.someFunction()`. Code that runs at the outermost level (outside a `def`) of a library script is **initialization** for the persistent parts of the script. It is not where callable code is placed.
