Error message with visiblity=MESSAGE in script parameters

Hello,

when I run this code from the script editor (Groovy)…

#@ String (visibility=MESSAGE, label="<html><b>Crop 3D images</b></html>") docmsg
#@ File[] (label="Tif 3D images", style="extensions:tif") inputFiles

import ij.IJ
import ij.gui.*
// Some comand

… I get the error message:

‘docmsg’ is required unset.

but if I add the property “required=false”…

#@ String (visibility=MESSAGE, label="<html><b>Crop 3D images</b></html>", required=false) docmsg

… it all works fine.
Can anyone reproduce this behavior? It’s not reported in the script parameters documentation.

I’m running Fiji / ImageJ 1.52n with Java 8 on Win 7 64 bits.

Thank you!

1 Like

Hi Nicolas,
Thanks for noticing, I updated the wiki accordingly.
@imagejan is it something that you were aware of ? Is the default value for required always true ?

@Nicolas you should also know that when macro-recorded such MESSAGE parameters unexpectedly shows up :sweat_smile:
There is the GenericDialog class of the ImageJ API as an alternative but it does not have a multi-file input, yet you could replace it with a folder input.