@@ -0,0 +1,1065 @@
+package imagej.ext.script;%0A%0Aimport imagej.ext.plugin.ImageJPlugin;%0Aimport imagej.ext.plugin.Parameter;%0Aimport imagej.ext.plugin.Plugin;%0A%0Aimport java.io.File;%0Aimport java.io.FileReader;%0Aimport java.io.IOException;%0A%0Aimport sun.org.mozilla.javascript.Context;%0Aimport sun.org.mozilla.javascript.ImporterTopLevel;%0Aimport sun.org.mozilla.javascript.Scriptable;%0A%0A/**%0A * Executes a script.%0A * %0A * @author Johannes Schindelin%0A */%0A@SuppressWarnings(%22restriction%22)%0A@Plugin(menuPath = %22Plugins%3EScript%3ERun Script%22)%0Apublic class ScriptPlugin implements ImageJPlugin %7B%0A%0A%09@Parameter%0A%09protected File path;%0A%0A%09@Override%0A%09public void run() %7B%0A%09%09// TODO make a nice SezPoz-discoverable interface for scripting%0A%09%09// languages%0A%09%09final Context context = Context.enter();%0A%09%09final Scriptable scope = new ImporterTopLevel(context);%0A%09%09try %7B%0A%09%09%09final Object result = context.evaluateReader(scope, new FileReader(%0A%09%09%09%09%09path), path.getName(), 1, null);%0A%09%09%09if (result != null)%0A%09%09%09%09System.out.println(result.toString());%0A%09%09%7D catch (final IOException e) %7B%0A%09%09%09e.printStackTrace(System.err);%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Add the initial stab at a plugin executing scripts