Re: Bug report: File.directory () builtin function fails in -batch
Posted by
dscho on
Mar 14, 2014; 3:45pm
URL: http://imagej.273.s1.nabble.com/Bug-report-File-directory-builtin-function-fails-in-batch-tp5006917p5006918.html
Hi Carnë,
On Fri, 14 Mar 2014, Carnë Draug wrote:
> The macro builtin function "File.directory()" does not work when
> starting ImageJ via command line -batch:
>
> 1) create a simple macro
>
> $ echo ''open (getArgument()); print (File.directory ());' >
> ./macro_test.ijm
I assume you meant a single single quote before the 'open'?
> 2) see how File.directory() fails, displaying an empty message on the
> log window
>
> $ ImageJ-linux32 -batch ./macro_test.ijm ./path_to_image
Are you sure that this works in _non_ batch mode? It does not work here,
and my investigation showed that only File.name is expected to work
correctly:
https://github.com/imagej/imagej1/blob/644e33c43593d8d1af400f87cb05f7b368aff93e/ij/macro/Functions.java#L2434Note how OpenDialog.setLastName() is called but not
OpenDialog.setLastDirectory().
Ciao,
Johannes
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html