Using options when launching a macro from another macro

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

Using options when launching a macro from another macro

Stein Rørvik
If I install a macro in some of the plugins-directories, it is conveniently callable from another macro using the run() command.

Like this:
run("My Macro");

It appears that the run() command will give access to nearly anything that appears in the ImageJ menus somewhere.

But if the called macro applies some options using the getArgument() function,
this does not work as expected; the options are ignored:

run("My Macro", "My Options");

If I use the run() command on a plugin, it works as expected:

run("My Plugin", "My Options");

Calling the macro using the runMacro() command allows options, however:

runMacro(getDirectory("plugins") + "MyPluginFolder/My Macro.ijm", "My Options");

Is this a bug, or a technical limitation?

The disadvantage of the runMacro() command is that you need to provide a full filepath,
which may vary between installations.


ImageJ mailing list: