print("\\Clear"); run("Close All"); dir = getDirectory("temp"); dir = replace(dir, "\\", "/"); //use forward slashes //create a sample tiff virtual stack run("T1 Head (2.4M, 16-bits)"); File.makeDirectory(dir + "t1-head/"); run("Image Sequence... ", "format=TIFF save="+ dir + "t1-head/"); close(); //import the same stack using three different valid syntaxes print("A:"); run("Image Sequence...", "open=["+ dir + "t1-head] sort"); OutPath = getDirectory("image"); print("OutPath: " + OutPath); //the path is now missing the trailing slash print("B:"); run("Image Sequence...", "open=["+ dir + "t1-head/] sort"); OutPath = getDirectory("image"); print("OutPath: " + OutPath); //the path now has a trailing slash print("C:"); run("Image Sequence...", "open=["+ dir + "t1-head/t1-head0000.tif] sort"); OutPath = getDirectory("image"); print("OutPath: " + OutPath); //the path is now missing the trailing slash