Cannot open file in macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot open file in macro

pavelsoukup
Hello,
I am trying to batch process all files in one folder and store the results in another. The script returns the "File is not supported format..." error. I can't seem to find what is wrong, appreciate any help.
Thank you!

The code:

input = "C:/Users/pavso/odrive/OneDrive4Business - JCU/PhD/Fiji.app/binary"
directory = "C:/Users/pavso/odrive/OneDrive4Business - JCU/PhD/Fiji.app/binary"

setBatchMode(true); 
list = getFileList(input);
for (i = 0; i < list.length; i++) {
        open(input+list[i]);    
	setOption("BlackBackground", false);
	run("Make Binary");
	run("Skeletonize (2D/3D)");
	run("Analyze Skeleton (2D/3D)", "prune=none calculate");

	selectWindow("Longest shortest paths");
	saveAs("Jpeg", directory + list[i] + "_paths")
	close();

	selectWindow("Tagged skeleton");
	saveAs("Jpeg", directory + list[i] + "_tagged")
	close();

	selectWindow(title);
	saveAs("Jpeg", directory + list[i] + "_skel")
	close();

	selectWindow("Results");
	saveAs("txt", directory + list[i] + "_res")
	close();
}
setBatchMode(false);

Reply | Threaded
Open this post in threaded view
|

Re: Cannot open file in macro

SarahV
Perhaps try replacing the file extensions with all-capital letters: "JPEG" and "TXT", respectively.