These are chat archives for fiji/fiji

6th
Mar 2018
Kabouik
@Kabouik
Mar 06 2018 14:00
Last year I used a folder batch .ijm script that I wrote based on that: https://imagej.net/Batch_Processing
Now I am trying to run it again, on the same folders, and I get an error because my script starts with "@" (the three lines defining input folder, output folder and suffix). I tried commenting them out with either "//" or "#", but of course then the following lines don't work because they do not know input.
Was there an update breaking this syntax, or is it possible that I edited the script in a wrong text editor that removed some important symbols due to wrong syntax highlighting?
Jan Eglinger
@imagejan
Mar 06 2018 14:02
@Kabouik the syntax is explained here: https://imagej.net/Script_Parameters
// @ is legacy and works
#@ is current recommendation
independent of the script language you choose
Kabouik
@Kabouik
Mar 06 2018 14:03
None of them work, I suppose there are other changes to apply to my script then
Jan Eglinger
@imagejan
Mar 06 2018 14:04
If in doubt, please open a topic on the forum with some example code and your installation details
Kabouik
@Kabouik
Mar 06 2018 14:04
But it that something that changed since last year? I wonder why my script was even starting with @ and not // if it didn't work back then (probably did a mistake with some alternate versions of the script)
For instance, with the current recommendation, I get an error from line 1: Statement cannot begin with "#" in line 1.
Curtis Rueden
@ctrueden
Mar 06 2018 14:17
@Kabouik The script syntax was enhanced, but it is supposed to be backwards compatible. If not, it is a bug. If you post the first 10 lines of your script, it would be helpful for analysis.
Kabouik
@Kabouik
Mar 06 2018 14:21

@ctrueden The script is short so it pasted it full here: https://hastebin.com/iwexirecox.php
This is with the #@, but it doesn't work here. Last time I used it successfully was last year so I don't quite remember the details. When I opened it today, there was no // or # before the "@". Perhaps that was an error, this was my first ImageJ script so I am not familiar with the syntax, but is that possible that it worked like that anyway last year?

In any case, it doesn't work now, fails right from these parameters at the top.

I can open a thread on the forum if that is easier, but it looks like I just got the syntax wrong somwhere, might not be worth cluttering the forum for a simple typo in a script.
Kabouik
@Kabouik
Mar 06 2018 14:57
Also, I get the same error if I do File/New/Script and Templates/ImageJ 1.x/Examples/Process folder (IJ1 macro), save the script, and execute it. FiJi says that the line 5 cannot start with #.
Kabouik
@Kabouik
Mar 06 2018 15:17
Alright it seems to work with the button "RUN" from the script editor (and "#@"), but not from Plugins/Macros/Run (weird, because I have another script that works from there). And I needed to edit the first lines to replace "style" with "value" to prefill the window asking for input and output paths.
Kabouik
@Kabouik
Mar 06 2018 15:26
Thanks @imagejan, @ctrueden, for pointing into the right direction.
amirffff
@amirffff
Mar 06 2018 18:16
Hi everyone
does someone programming with imageJ/Jthon and can help me please?
Curtis Rueden
@ctrueden
Mar 06 2018 20:18
@Kabouik The Plugins/Macros/Run is an ImageJ 1.x command, which has not been tested with ImageJ2 scripts. Sorry for the confusion there.
@Kabouik The syntax looks correct, apart from the style attribute being used incorrectly, yeah.
The script should work if you press Run in script editor, and it should work if you place it into $IMAGEJ_DIR/scripts/Foo/Bar. Then it will appear in the Foo > Bar menu and should work from the menus, as well.
Curtis Rueden
@ctrueden
Mar 06 2018 21:56
NOTICE: The ImageJ server infrastructure will be going down within the next few minutes. Downtime should be short (less than 10 minutes).
Curtis Rueden
@ctrueden
Mar 06 2018 23:04
Servers should all be back online; please ping if you notice otherwise.