Re: souce directory code for writing macro

Posted by Ninja Chris on
URL: http://imagej.273.s1.nabble.com/souce-directory-code-for-writing-macro-tp3689273p3689277.html

Hi Ben and Teresa,

I'm having similar issues writing to a specific folder. In my case I am duplicating ROIs from a stack and saving them as separate stacks, ideally in subfolders created in the parent. It all works well at the moment except the saving to the subfolders. Instead of ending up in the appropriate ones all the stack images get dumped in the parent. If either of you have any idea where the error lies in my code I'd be most grateful if you could point it out!

Many thanks,
Chris


sdir = getDirectory("choose source directory ");
n = roiManager("count");
for (i=0; i<n; i++) {
     roiManager("select", i);
     bee = "bee_"+i+"_";
     ddir = sdir+bee;
     File.makeDirectory(ddir);
     run("Duplicate...", "title = ["+bee+"] duplicate range=1-3000");
     run("Image Sequence... ", "format=TIFF name=["+bee+"] start=0 digits=4 save=["+ddir+"]");
close();
  }