Installing a macro replaces other macros

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Installing a macro replaces other macros

Ben Forbes
Whenever I install a macro using Plugins -> Macros -> Install... it
replaces all existing macros in the menu with the new one. According
to

http://rsbweb.nih.gov/ij/docs/guide/userguide-28.html

the macros should be added to the bottom. Could this be fixed please?

I'm using ImageJ 1.45j on Windows 7 64-bit.

Cheers,
Ben

--
Benjamin D. Forbes
School of Physics
The University of Melbourne
Parkville, VIC 3010, Australia
Reply | Threaded
Open this post in threaded view
|

Re: Installing a macro replaces other macros

Tiago Ferreira-2
On 2011.06.28, at 20:44 , Ben Forbes wrote:
> Whenever I install a macro using Plugins -> Macros -> Install... it
> replaces all existing macros in the menu with the new one. According
> to http://rsbweb.nih.gov/ij/docs/guide/userguide-28.html
> the macros should be added to the bottom. Could this be fixed please?

Der Ben,

It is a misunderstanding.
By design you can only have one set of macros installed at a time.
As such, Plugins>Macros>Install... will only append to the
Plugins>Macros> submenu the last installed macro set.

The revised version of the User guide (due later this year), will be
more clear about this aspect.

That being said, there are several ways to overcome this "limitation"

1) Using toolsets:
   Save your macro files in ImageJ/macros/toolsets folder. That way you
   can use the ">>" toolbar menu to activate groups of macros, tools
   as well as toolbar menus

2) Saving your macros in the ImageJ/Plugins directory:
   Macro files saved with a '.ijm' extension and placed in the plugins
   folder hierarchy will appear in the Plugins> menu. These macros are
   treated as regular IJ commands (e.g., listed by the Command FInder).
   Macros with a '.txt' extension must contain at least one underscore
   in the filename.

3) Using the Action Bar Plugin by Jerome Mutterer:
   <http://imagejdocu.tudor.lu/doku.php?id=plugin:utilities:action_bar:start>

4) Hosting extra functions in a fixed repository that can then be shared
   between macros using:
      functions = File.openAsString(thePathtoMyFancyFunctions.txt);
      call("ij.macro.Interpreter.setAdditionalFunctions", functions);

On a related note and in case you are interested in merging macro files,
note that you can use the built-in macro function runMacro(name) to easily
call a macro from another

HTH,
-tiago