# How to get the ScriptManager inside Gateway Module Java

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-the-scriptmanager-inside-gateway-module-java/56137>\
**Category:** Module Development\
**Created:** [February 14, 2022, 10:07pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-scriptmanager-inside-gateway-module-java/56137 "2022-02-14T22:07:35Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![kevin.setter](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@kevin.setter](https://forum.inductiveautomation.com/u/kevin.setter)\
**Post date:** [February 15, 2022, 2:30am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-scriptmanager-inside-gateway-module-java/56137/4 "2022-02-15T02:30:47Z")

</div>

@pturmel I see, thanks about the Optional. I should have just googled “Optional java”

I was attempting to follow this thread for a starter in my learning path here. It’s a bit old (2013)

[Executing Python from Module - 3rd Party Modules - Inductive Automation Forum](https://forum.inductiveautomation.com/t/executing-python-from-module/6073/9)

Does this line work to get a ScriptManager per project?  
com.inductiveautomation.ignition.common.script.ScriptManager mgr = ctx.getProjectManager().getProjectScriptManager(projectId)

@paul-griffith I’m trying to call pre-defined scripts from the Project Library. I am trying to call them from the handleEvent(…) method in the MobileComponentModelDelegate. The trigger (firing) is from the React component button that sends a message in the example code.

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-get-the-scriptmanager-inside-gateway-module-java/56137)._
