Multiple macros in one script

Hello,
Relatively new to macro scripting in Fiji. Going through tutorials, and examples, but issue is hounding me.
When writing two consecutive macros (with print statements) in the scripting editor, and then running within the editor, the log window just shows the results of the first macro within the script. How do I ensure the log window keeps posting output with in the same script?

macro "Macro 1" {
    print("This is Macro 1");
}

macro "Macro 2" {
    print("This is Macro 2");
}

Am I overlooking something fundamental as applied to executing multiple macros within the same script?

Regards

See:

Hello @NRW, welcome to the forum!

Perhaps this is a nomenclature issue?

Macros in files are great for having blocks of code than can be called from the Macros menu or from buttons or shortcuts, but they will only run individually when called.

Within a script, you can write functions when you want to run chunks of code multiple times, which is perhaps what you’re trying to do?

Hope that helps.

1 Like