imagej-launcher icon indicating copy to clipboard operation
imagej-launcher copied to clipboard

Support SciJava scripting framework better

Open dscho opened this issue 10 years ago • 1 comments

@PaulVanSchayck pointed out that the Javascript support only works in Fiji.app/, not in ImageJ.app/. The best fix is to let the scripting framework handle things.

So if we detect that the first argument is a path to an existing file with a non-empty file extension, we should spin up a Context and ask the ScriptService whether it knows about the file extension, and let it handle the execution if it does.

This does not fix ImageJ-<platform> --js -- which is supposed to open an interactive console -- of course, but that is something we might have to address in the ScriptService instead (or in a to-be-introduced ScriptInterpreterService).

dscho avatar Jun 24 '14 13:06 dscho

Would this bug also explain why the load('otherfile.js') function cannot be used when calling a script from Plugins -> Macros -> Run or when calling the script using ImageJ-linux64 -macro script.js. When using the new ScriptEditor and pressing ctrl+r it does work.

The error in the cases load() is not working is:

   ReferenceError: "load" is not defined. (<Unknown source>#43) in <Unknown source> at line number 43

This only happens in Linux by the way, in Windows I can use Plugins -> Macros -> Run. This is all IJ2-rc13.

PaulVanSchayck avatar Aug 15 '14 09:08 PaulVanSchayck