I develop macros for users and I send them interim versions with data (images) in a folder. The folder is at a completely different path once it lands on their computer, so I can’t embed paths in the open() command that will work on their computer. Has someone figured out a way to ID the folder from which a macro is run. The macro may be run by dragging it to IJ, or by double clicking it in the Win10 file system once .ijm is associated with IJ, however a macro has no reference from which folder it came, so any images opened can’t be found. I’m adding a simple macro in the folder to be run first that contains the single command <getDirectory(“Choose The Downloaded Directory”);> which asks the user to select the folder where the data and main macro are. This is clunky, but I don’t want the user to have to ID the folder each time he/she runs the main macro by putting the same command in the algorithmic macro. IJ remembers which directory it last opened an image from, but does not do the same for macros, so opening an image from the folder first will accomplish what’s needed, but I would like the user to be able to just double click the macro and have it open the images in the same folder.
Has any one figured out how to ID a folder from which a macro has been run?