Login  Register

Help to save open image in Process>Batch>Macro

Posted by sdegan on Jun 07, 2013; 5:47pm
URL: http://imagej.273.s1.nabble.com/Help-to-save-open-image-in-Process-Batch-Macro-tp5003285.html

Hi All,
I need some help on how to save the open image that results from the batch processing using the Process>Batch>Macro

I have tried the following command at the end of the macro in the 'Batch Process' window. However, this allows me to choose a directory and save only one image at a time. Every time I am prompted to choose the directory and save the image:

//the following is inserted at the end of the macro in the 'Batch Process' window
 
fullpath = getDirectory("");
N = nImages;
for (i=0; i<N; i++) {
    dir = fullpath + getTitle() +".jpg";
    saveAs("jpg", dir);
    run("Close");
}

Is there a way to have the resulted image from the batch to be saved automatically in a specified directory?

Many thanks for any help