Headless mode and conditional Scripting Parameters

fiji
jython
scijava
plugin
python
headless
scriptparameters
Tags: #<Tag:0x00007fb87e01f200> #<Tag:0x00007fb87e01f070> #<Tag:0x00007fb87e01eee0> #<Tag:0x00007fb87e01ed78> #<Tag:0x00007fb87e01eb98> #<Tag:0x00007fb87e01e990> #<Tag:0x00007fb87e01e800>

#1

Dear All,

Currently, I am trying to pass arguments to my script in headless mode. I am using - xvfb-run -a $HOME/Fiji.app/ImageJ-linux64 --ij2 --run myscript.py 'arg="argument" as a command in my shell and it works fine (I need a GUI unfortunately, that’s why I am using Xvfb).
Now I am wondering if I could hide the dialogue prompted by the #@String arg parameter, since I don’t need it if it’s not in headless mode. Can I embed the parameter in a condition? Or is there a boolean type of variable that I could use to test whether something is headless or not?

Thank you very much!
Cheers,
David


#2

How does that go together: you need a GUI, but want to run your script headless?? :slight_smile:

Would you mind explaining why you want to run in headless mode? If you have a script using #@ script parameters, you can simply use the macro recorder to record a command allowing to call the script with pre-filled parameters, if that’s all you need.