Command Line API does not work using the variable for multiple macros in a folder

When running a folder contains two macros passing same variable (to both macros in the folder) through the command line API, the variable is passed to first macro. For the second macro, the variable is not displayed, it displayed as NON_SET.

“C:\Program Files\Mozilla Firefox\firefox.exe” “file:///C:/Users/venna001/Downloads/ui.vision.html?folder=Test1&cmd_var1=1&direct=1&savelog=logfirefox.txt”

Here are the screenshots for both macros
Macro1

Macro2

Any suggestions on this?

The solution is to store the command-line value in a global variable in the first macro.

store | ${!cmd_var1} | global_myvar

Now ${global_myvar} can be accessed in any macro!

Thanks Plankton. It is working for same variable used in the different macros in the folder.

One more scenario, when running a folder contains two macros passing to different variables (one variable to first macro and second variable to second macro in the folder) through the command line API, the variable is passed to first macro. For the second macro, the variable is not displayed, it displayed as NOT_SET. Used both myvar and global_myvar for both variables, didn’t work for the second variable in second macro, displayed as NOT_SET.

“C:\Program Files\Mozilla Firefox\firefox.exe” “file:///C:/Users/venna001/Downloads/ui.vision.html?folder=Test1&cmd_var1=1&cmd_var2=5&direct=1&savelog=logfirefox.txt”

Here are the screenshots for both macros
Macro1

Macro2

Any suggestions on this scenario?

Store all command line variables in the 1st macro, using different global variables for each e. g. ${global_myvar1}, ${global_forMacro2}, etc

!cmd_var1, !cmd_var2 and !cmd_var3 are empty (undefined) after the 1st macro. So use them in the 1st macro only.

It worked. Thanks Ulrich.