> On Jun 20, 2015, at 3:41 PM, Christophe Leterrier <
[hidden email]> wrote:
>
> Hi,
>
> Is there a way for an ImageJ javascript to report from which folder it
> running (i.e. the path to the js file or to its parent folder)?
You can get the folder of a installed macro or script by looking up the command name in the list of menu commands. For example, I have a JavaScript named Split_Bayer.js in plugins/Tools and this JavaScript
commands = Menus.getCommands();
name = commands.get("Split Bayer");
if (name==null) name="null";
start = name.indexOf("\"");
end = name.indexOf("/");
print("folder="+name.substring(start+1,end));
returns
folder=Tools
-wayne
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html