Getting return values from an ImageJ Macro Script leads to crash

Hello everyone,

I am a complete beginner in regards to working on ImageJ and am on the way to integrating an existing Macro Script into a plugin. Running the macro with the ScriptService without using get() works great (scriptService.run(macro_file, true);), but with it included it already stops working there. I would be most obliged for any advice on how to resolve this problem.

try {
	//scriptService.run(macro_file, true);
	final Future<ScriptModule> returnVal = scriptService.run(macro_file, true);
	final ScriptModule resolvedReturn = returnVal.get();
	final Object filename = resolvedReturn.getReturnValue();
	System.out.println(filename);
} 

The Java Future returnVal never resolves and thereby blocks execution of anything else.