Install macros to be automatically loaded at startup

fiji
imagej
macro

#1

So I wrote my first macros and I am pleased with the result. Everytime I start fiji, I need to do:

Plugins > Macros > Install

Search for the file ‘MyMacros.ijm’ located in the ‘Fiji.app/macros’ folder.

I’d like to have those two macros be loaded automatically at startup.

Searching on the net for an answer, I only found a very confusing thread:

Basically it seems that copy/pasting those two macros in the file ‘StartupMacros.fiji.ijm’ is a bad idea since it will get deleted upon the next update.

So where/how should one install macros so that they do not confuse the updater ?

As a side note, the documentation is rather confusing with the naming convention, one document refers to ‘StartupMacros.txt’:

While it seems fiji prefers ‘StartupMacros.fiji.ijm’:

Thanks


#2

Hi malaterre,

there may be other ways to go about this, but one option you may find useful is to put all your macros in the same txt file, delimited as follows:

macro "Name of one of your macros Action Tool - C000 T5e13A" {
//Put your macro code here
}

macro "Name of another one of your macros here Action Tool - C000 T5e13B" {
//Put your macro code here
}

//continue as needed

and then save this text file with whatever name you want to the ‘macros>toolsets’ folder. Then when you launch imagej you can install all your macros by clicking the ‘>>’ button on the toolbar and finding your txt file save name. All your macros should then appear on the toolbar as buttons. So not exactly what you have asked for, but perhaps useful none-the-less.

Note1) from the imagej site: “A macro file can contain up to eight macro tools, along with any number of ordinary macros.”

Note2)
The combinations of letters and numbers after the hyphen ‘-’ designates what will appear in the macro button (see https://imagej.nih.gov/ij/developer/macro/macros.html Tool Icons subheading). Basically Cxxx designates colour (in this case black 000 in rgb) and the second part beginning T indicates an ASCII alphabet letter will be displayed in a certain xy location (in this case the first macro will have a button with a black ‘A’ on it, and the second will have a button with a black ‘B’ on it).

Kind regards.