Opening Image Sequences in Subfolders and process them individually

Hi all,

I’ve been trying to write and recording a macro to open image sequences in different subfolders and process them individually (each sequence).

What I have so far (partially copied from another forum):

dir = getDirectory("Choose Source Directory “); //select main directory
list = getFileList(dir);
for (i=0; i<list.length; i++) {
incoming= dir+list[i];
run(“Image Sequence…”, “open=[”+incoming+”] "); //opens image sequences as a stack already
run(“Zprojections”) //secondary macro that I would like to run for every image sequence.

What I would like to modify is to open each image sequence individually, process them with “Zprojections” and then proceed to the next subfolder.
Atm the macro is opening the different subfolders simultaneously.

Thanks in advance for any tip,


Hi @Joao_Garcia

Just take a look at this other Forum post… I think the answer to your question lies in that posted code. You will have to adapt it and play a bit - but should work for you. Also - Script Parameters would be a better way to call in to the directory/subfolders (as indicated in that posted code).

Hope this helps! If not - just reply with your questions, etc.

eta :slight_smile: