Hi,
why catch an exception?
You can use
File.exists(path)
to check whether a file exists, or use
getFileList(directory)
to get a list of all files in a directory; then use String matching ('matches') to extract a list of the relevant ones.
You can get the number of ROIs in the ROI Manager by
n= roiManager("count");
Michael
________________________________________________________________
On May 24, 2012, at 21:19, ncarducci wrote:
> I am trying to write a macro that allows me to open a set of previously
> generated nodes in the ROI Manager, then use those nodes to straighten the
> ROI on a tiff image. I can do it if there is only one set of nodes per
> image, but alas, I have a variable number of nodes per image. To work around
> this, I tried to implement a try/catch statement to attempt to open the
> nodes and catch the FileNotFound exceptions that occur. This obviously
> doesn't work, or I wouldn't be posting here.
>
> What my question boils down to is: is there any way for me to catch an
> exception that I know will be generated by the macro, and allow the macro to
> catch it and proceed on?
>
> Thanks in advance
>
>
>
> --
> View this message in context:
http://imagej.1557.n6.nabble.com/Handling-errors-in-Macros-tp4998797.html> Sent from the ImageJ mailing list archive at Nabble.com.