title = "What is your image name image?"; msg = "Click \"OK\", then choose the text file which contains the image name. "; waitForUser(title, msg); filename = File.openAsRawString(""); dir = getDirectory("Choose the folder of target image"); list = getFileList(dir); dir2 = getDirectory("Choose the folder to save the cut image"); dir3 = getDirectory("Choose the folder to save the red image"); dir4 = getDirectory("Choose the folder to save the green image"); savepath = dir2 + filename savepath2 = dir3 + filename savepath3 = dir4 + filename for (i=0; i