Login  Register

Re: Auto-launching macros (was Re: startup)

Posted by Wayne Rasband on Jul 12, 2005; 6:06pm
URL: http://imagej.273.s1.nabble.com/Auto-launching-macros-was-Re-startup-tp3705027p3705030.html

> I have a problem similar to Charlotte Holmes'.  I'd like to
> be able to open a macro and have it execute automatically,
> without the "Run" command.

Macros named "AutoRun" execute automatically when they are opened or
installed. For example, the macro

   macro "AutoRun" {
       run("Close"); // close text window
       print("This macro automatically runs when it is opened");
   }

executes when you open it using File>Open or drag and drop it on
ImageJ. The run("Close") statement closes the text window that is
opened when you open a macro file.

> It's my understanding that I can create a macro named
> StartupMacro.txt, put it into the macros folder, and have it
> execute automatically when ImageJ starts.

If you have a macro named "AutoRun" in StartupMacro.txt then it will
run automatically when ImageJ starts.

-wayne