http://imagej.273.s1.nabble.com/Forward-slashes-do-not-work-for-default-directories-tp5019697p5019698.html
filename separator. It is a bit of a hassle to concatenate it in, but it
makes your code work on systems with different file separators.
> I need to set the default directory for saving both images and text in a macro.
> According to various mailing list postings this can be done using a javascript call to
> ij.io.OpenDialog.setDefaultDirectory for images and ij.plugin.frame.Editor.setDefaultDirectory for text.
>
> The problem is that it does not work for me if the filepath is using forward slashes.
> I prefer to use forward slashes as they are far more compatible and do not need escaping.
> I am using daily build ImageJ 1.51s on Windows 7 64-bit.
>
> Here is a test macro illustrating what I want to do:
>
> //The following does not work:
> dir = "C:/Users/steinr/ImageJ/Files/";
> call("ij.plugin.frame.Editor.setDefaultDirectory", dir);
> call("ij.io.OpenDialog.setDefaultDirectory", dir);
> //saveAs path for both Text windows and images are set to the last used directory for saving
>
> //The following works as expected:
> dir = "C:\\Users\\steinr\\ImageJ\\Files\\";
> call("ij.plugin.frame.Editor.setDefaultDirectory", dir);
> call("ij.io.OpenDialog.setDefaultDirectory", dir);
> //saveAs path for both Text windows and images are now set to the desired directory
>
> Can this be fixed, or is it a limitation of Java / Windows?
>
> Stein
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>