I have three different folders with each contains same number of images. I have already sorted those images to make sure them in order. Then I try to batch merge images from three folders, e.g. the 1st images from each folder will merge.
I have not loop this macro yet because I don’t understand why the merge function doesn’t work.
macro "merge channels"{
setBatchMode(true);
file1= getDirectory("Choose a Directory");
list1= getFileList(file1);
file2= getDirectory("Choose a Directory");
list2= getFileList(file2);
file3= getDirectory("Choose a Directory");
list3= getFileList(file3);
open(file1+list1[1]);
open(file2+list2[1]);
open(file3+list3[1]);
run("Merge Channels...", "c1=list3[1] c2=list2[1] c4=list1[1] keep");
//setBatchMode(false);
}
This macro can open three files as I want.
The file1,file2,file3 are the paths, the list1,list2,list3 are the filenames. I printed them which shows clearly.
So the only problem is the :
run("Merge Channels...", "c1=list3[1] c2=list2[1] c4=list1[1] keep");
Problem:
“list[3]” is not a valid choice for “C1(red):”