Hi Philippe,

hmm, I think you got the solution already, it works for me (at least I can see the directory in the image Info:

filePath="/home/schmid/tmp/";
dummy=eval("script", "IJ.getImage().getOriginalFileInfo().directory = \"" + filePath + "\";");

People who don't like escaping inner quotes with the backslacsh character could also write dummy=eval('script', 'IJ.getImage().getOriginalFileInfo().directory = "' + filePath + '";');

(I assigned the output of "eval" to a dummy variable; otherwise the directory is written to the Log window.)

Maybe your directory path was missing the trailing slash?


Michael
________________________________________________________________
On 05.09.24 16:59, CARL Philippe (LBP) wrote:
Dear all,
Within a macro I would like to set the File.directory parameter of a picture obtained 
through a Image>Stacks>Tools>Concatenete... process (given that this parameter 
is read by a plugin I want to apply on the concatened picture).
Given that filePath is the String containing the path I would like to set, I 
tried to use the following macro code (without any success):
        eval("script", "IJ.getImage().getOriginalFileInfo().directory = \"" + filePath + 
"\";");
I guess I'm not too far from the solution, but can't reach it.
I thank you very much in advance for your help on this.
My best regards,
Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 41

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

Reply via email to