Login  Register

Re: How do you open files that have brackets in the filename in a macro?

Posted by jchanson on Apr 21, 2017; 2:40pm
URL: http://imagej.273.s1.nabble.com/How-do-you-open-files-that-have-brackets-in-the-filename-in-a-macro-tp5018579p5018584.html

Thanks for the tips on dealing with filenames with brackets in them.  Renaming the files so they didn't have brackets would be the easiest thing to do -- thanks, Michael for the simple windows command for stripping them out.  However, just using the plain "open" command worked, too (thanks, Kees for showing that it worked).  With some googling, I was able to find the macro extension command equivalent of the open command to use BioFormats.  The following was able to open my file with brackets in the filename:

// Load Bio-Formats extensions so that the "Ext." bioformats commands are available.
run("Bio-Formats Macro Extensions");
file = "awkward_filename_[39254,8006]_component_data.tif";
Ext.openImagePlus(file);


Thanks again everyone,
Jeff

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