Login  Register

Re: Scripting IJ with javascript

Posted by Gabriel Landini on Feb 22, 2009; 11:07am
URL: http://imagej.273.s1.nabble.com/Scripting-IJ-with-javascript-tp3693611p3693616.html

Thank you Wayne & Thomas,

On Saturday 21 February 2009, Rasband Wayne wrote:
> To support Undo, call both ip.snapshot() and Undo.setup(), as in this
> example:

> Access the public Prefs.blackBackground variable to find out if
> "Black Background" is true or false.

That is what I was looking for.

By the way I just noticed that one cannot re-edit a .js file via the
Plugins>Macros>Edit...  menu (expects .txt or .java extension).

One can drag and drop these, though.

I guess that this needs changing line 179 of Compiler.java from (I have a
slightly old source):

} else if (!(lcName.endsWith(".java")||lcName.endsWith(".txt")||
lcName.endsWith(".ijm"))) {

to:

} else if (!(lcName.endsWith(".java")||lcName.endsWith(".js")||
lcName.endsWith(".txt")|| lcName.endsWith(".ijm"))) {


Many thanks again,


Gabriel