# Call Script function from Module

**URL:** <https://forum.inductiveautomation.com/t/call-script-function-from-module/32377>\
**Category:** Module Development\
**Created:** [February 18, 2020, 3:05pm UTC](https://forum.inductiveautomation.com/t/call-script-function-from-module/32377 "2020-02-18T15:05:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![roland.scheuer](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@roland.scheuer](https://forum.inductiveautomation.com/u/roland.scheuer)\
**Post date:** [February 18, 2020, 3:05pm UTC](https://forum.inductiveautomation.com/t/call-script-function-from-module/32377/1 "2020-02-18T15:05:31Z")

</div>

Hello,

is it somehow possible to call a own script function from a Module?

```auto
def foo(params)
      print params

```

Something like

ScriptManager.call(“tools.foo” , params)

br,  
Roland

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 18, 2020, 9:41pm UTC](https://forum.inductiveautomation.com/t/call-script-function-from-module/32377/2 "2020-02-18T21:41:03Z")

</div>

Generally speaking, you’re going to have a much easier time doing this if you just write your logic in Java, _but_, you could technically run an arbitrary script from the `ScriptManager` available on the context object your module’s hook will get during `setup()` in whatever scope(s) it’s registered for. `CommonContext` defines `getScriptManager`, which has various `runCode` and related overloads; eg:  
`com.inductiveautomation.ignition.common.script.ScriptManager#runCode(java.lang.String, org.python.core.PyObject, java.lang.String)`
