I was trying to run on a windows machine the jython example code for Headless mode from the wiki
#@String name1 #@String name2 print('Hello ' + name1 + " and " + name2)
with the command
ImageJ-win64.exe --ij2 --headless --console --run PathToScript/hello.py 'name1="Mr",name2="Mrs Kraken"'
but it did not work, either I had :
[WARNING] Ignoring invalid argument: --run
I fixed this one by enclosing the path to my script in double quotes “Path.script.py” (single ones do not work)
[ERROR] Ignoring extraneous argument: org.scijava.parse.DefaultParseService$ItemsList$1@6749fe50
For this one I enclosed the full tuple in double quotes and the string parameters in single quotes
So that the working version was :
ImageJ-win64.exe --ij2 --headless --console --run "C:/Users/Laurent Thomas/Desktop/test_.py" "name1='Mr',name2='Mrs Kraken'"
There are many forum posts about the headless mode with different recommendations that can be confusing.
I would like to update the command from the wiki with :
--consoleargument otherwise we have no idea when the script execution fails
the functionnal formatting above with the double/single quotes
Yet I am wondering if this is specific from the windows system, does the current command line from the wiki works on linux ? So that an additional version of the command for windows system should be added instead.
PS: I am using the native Command Line Prompt of windows