Save results is text file issue

Hi everyone
I am beginner in ImageJ, sorry if I am digging up a dead topic. I have in a
emergency situation that have to ask it.

I am trying to analyze a sequence of images of few particles that I have to
write the position of this particles in text files. I am using this macro
but in the save as part I ma getting an error.

please help if you know whats going on!

num = getNumber("number of images : ",100) ;
for(id=num-1; id >= 0 ;id--)
{

if ( id < 10)
open("/Users/zjalilvand/Desktop/test/images000"+id+".tif");
if ( id > 9 && id < 100)
open("/Users/zjalilvand/Desktop/test/images00"+id+".tif");
if ( id > 99)
open("/Users/zjalilvand/Desktop/test/images0"+id+".tif");


run("Analyze Particles...", "size=100-1000 circularity=0.0-1.00 show=Nothing
display clear slice");
saveAs(“measurements”,
”Users/zjalilvand/Desktop/test/results/Results"+id+".txt");
close;
}

Welcome to the forum, @zhhjll!

To find the issue, it would help tremendously if you pasted the exact error message here.

Looking at your code, I noticed that some of the quotes (") are actually and , possibly due to some auto-replacement by a word processing software or an email client. Looking at the syntax-highlighted macro code in the script editor usually helps to detect this kind of problems.

1 Like