Headless macro concatenates filepath and filename

Hi!

I am trying to run a macro using ImageJ in headless mode on Windows. The following is run at the command line (cmd.exe):

ImageJ-win64.exe --ij2 --headless --console --run C:\Macro\macro.ijm 'input="../TIFFs/",output="../postmacro/"'

The script contains the following lines:

function action(input, output, filename) {
    print(input + filename);
}

#@String input
#@String output
extension2 = ".tiff";


list = getFileList(input);
for (i=0; i < list.length; i++)
  action(input, output, list[i]);

And the output is the following:

../TIFFsImage1.tiff
../TIFFsImage2.tiff
../TIFFsImage3.tiff

How can this be fixed to become

 ../TIFFs/Image1.tiff

?

Many thanks in advance,

Geo

Solved it. Need to swap the quotes/double-quotes from the argument

'input="../TIFFs/",output="../postmacro/"'

to

"input='../TIFFs/',output='../postmacro/'"
2 Likes