Macro Help

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Macro Help

AJBell
Hi all,

I'm writing a macro to:

open certain image files from a folder containing mixed files, then open the corresponding roi.zip file (same folder) and perfrom measurements. The macro below works sometimes, but it often produces an error saying the "File is not in a supported format, a reader plugin is not available or it was not found". I know the file does exist, and can be loaded. Any ideas as to what i've done wrong?

The roi zip file name is the same as the image name, with the addition of ROI.zip.

dir = getDirectory("Choose Source Folder");
a = getFileList(dir);

        for (i=0; i<a.length; i++) {
                showProgress(i+1, a.length);
               
        if(endsWith(a[i], ".tif")) {
                open(dir+a[i]);
                name = getTitle();
                type = indexOf(name, "Phase");
                                       
                        if(type == -1) {
                                open(name+"ROI.zip");
                                roiManager("Measure");
                                roiManager("Delete");
                                close();
                               
                        }else{
                                close();
                                        }
                                }
        }

Any suggestions welcome.

Andrew