How to get the ScriptManager inside Gateway Module Java

@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

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

@PGriffith 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.