Login  Register

Re: Every time an image is opened

Posted by dscho on May 19, 2010; 7:23pm
URL: http://imagej.273.s1.nabble.com/Every-time-an-image-is-opened-tp3688256p3688257.html

Hi,

On Wed, 19 May 2010, SHW wrote:

> Is there way to do an action/Macro/etc. every time an image is opened,
> automatically?

You do not need to write Java, Javascript is plenty enough (if you are on
Java6, or use Fiji). We actually have a very nice example since quite some
time on our Wiki:

http://pacific.mpi-cbg.de/wiki/index.php/Javascript#Interfaces_and_anonymous_classes

And you can call that from a macro using the eval("script", javascript)
function:

http://rsb.info.nih.gov/ij/developer/macro/functions.html#eval

Ciao,
Johannes