Ron,
Use brackets to denote string variables with spaces.
macro "Save Stack [f2]"{
dirOutput = getDirectory("Choose Output Directory for stack");
Dialog.create(" Macro Options ");
Dialog.addString("Enter Filename for stack ","fileName");
Dialog.show();
fileNameStack = Dialog.getString();
run("Image Sequence... ", "format=TIFF name=["+fileNameStack+"] digits=3 save=[dirOutput]");
}
Glen MacDonald
Core for Communication Research
Virginia Merrill Bloedel Hearing Research Center
Cellular Morphology Core
Center on Human Development and Disability
Box 357923
University of Washington
Seattle, WA 98195-7923 USA
(206) 616-4156
[hidden email]
On May 1, 2015, at 12:15 PM, Paletzki, Ron (NIH/NIMH) [C] <
[hidden email]> wrote:
> I have a macro that creates a stack and then tries to save it to a folder using the Image Sequence command. Problem is it works fine if the folder it’s saving to has no spaces in the name but fails if it does. I’m wondering if this is a bug since it has never been an issue before in other macros using other save and open commands. This is the first macro using the Image Sequence command.
>
> Here is an example macro that demonstrates the bug. With a stack open if I run this macro and select a folder with a name that contains a space in it I get an error
> “File Saving error (IOException):
>
> If I select a folder that does not contain a space in the name it works fine.
>
> macro "Save Stack [f2]"{
> dirOutput = getDirectory("Choose Output Directory for stack");
> Dialog.create(" Macro Options ");
> Dialog.addString("Enter Filename for stack ","fileName");
> Dialog.show();
> fileNameStack = Dialog.getString();
> run("Image Sequence... ", "format=TIFF name="+fileNameStack+" digits=3 save="+dirOutput);
> }
>
>
> By the way this in running on a Mac using Image 149s8
>
> Thanks
> Ron
>
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html