Login  Register

String Manipulation in Macros

Posted by ptandon0 on Aug 15, 2009; 5:13pm
URL: http://imagej.273.s1.nabble.com/String-Manipulation-in-Macros-tp3691475.html

Hi,

I'm using the BatchProcessFolders.txt macro included with imageJ to split channels of 16 bit images. I need to modify the filenames to save the results.

The full filename is passed to function processFile(String path) as a string, but i would like to modify this String to change the filename, something like:

saveAs("Tiff", path.substring(0,path.length()-4)+" - green.tif");

But the macro doesn't seem to have access to String methods, and returns the error "length expected in line 45."

Anyone know a way around this?

Using ImageJ 1.42q.

>ptandon