Posted by Krs5 on May 26, 2020; 3:51pm URL: http://imagej.273.s1.nabble.com/Macro-to-split-images-and-save-as-title-tp5023353p5023399.html
Dear Marc,
OK, so ImageJ does not recognize the file name opened by the plugin. So we can use something like
title = File.getNameWithoutExtension(path);
But we still have to take care that each channel is saved correctly. If the channels are split is the naming like "C1-imageName" or "imageName (red)"?
Kees
________________________________
Deer Kees,
Thank you very much for helping! I copied the macro into the editor and
removed gremlins as you described and checked that the " look the same (it
doesn't appear to have been changed). When running the macro I get asked
first source then destination directory as expected. It then asks me to
select a file (but only a single one, if I run it as batch would it be able
to take a whole directory of files?). However, after opening the file and
splitting it I get the following error message:
Number or numeric function expected in line 10
title = File.getNameWithoutExtension();