Login  Register

Re: How can I get the directory of a macro file?

Posted by Wayne Rasband-2 on May 09, 2018; 4:42am
URL: http://imagej.273.s1.nabble.com/How-can-I-get-the-directory-of-a-macro-file-tp5020635p5020636.html

> On May 8, 2018, at 11:27 PM, bens0545 <[hidden email]> wrote:
>
> I want to copy my macro file into different folders, and have the macro
> operate on the files in that folder. Currently I am typing the new directory
> path into the macro, but I would like the macro to get the directory that it
> is in automatically. How can I do this?

The File.directory() macro function returns the path to the directory that a macro was loaded from.

-wayne

> --
> Sent from: http://imagej.1557.x6.nabble.com/

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