Re: "Save As" dialog

Posted by Jerome Mutterer-3 on
URL: http://imagej.273.s1.nabble.com/Save-As-dialog-tp5005581p5005582.html

Hi Kenneth,

you can get the original directory from which the .tif file came using:
  path =  getInfo("image.directory");
and then set the default SaveAs directory using:
  call("ij.io.OpenDialog.setDefaultDirectory", path);
which you can then wrap into a simple customSaveAs macro

macro "customSaveAs [s]" {
  path =  getInfo("image.directory");
  call("ij.io.OpenDialog.setDefaultDirectory", path);
  run ("PNG...");
}

Now pressing the 's' key will pop up a save as png dialog which defaults to
the current image directory. You could also add this macro to the
StartupMacros.txt file in the macros folder to have it installed at startup.

If you prefer avoiding save as dialogs completely, you could also use the
Process>Batch>Convert... command ;-)


Jerome.





On 17 November 2013 05:57, Kenneth Sloan <[hidden email]> wrote:

> I routinely use ImageJ to convert files from (for example) .tif to .png.
>  This is quite easy - with one nasty speed bump.  The "Save As" dialog
> defaults to the last used directory, and the same filename as the .tif file
> (minus, of course, the .tif extension).
>
> It would be much easier for me if the DIRECTORY also defaulted to the
> original directory from which the .tif file came?
>
> Am I missing an easy way to do this?  As it is - I  lose a lot of time
> re-setting the directory (and sometimes forget, which wastes even more time…
>
> --
> Kenneth Sloan
> [hidden email]
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html