Saving "Results" table on Mac vs PC in ImageJ macro

I wrote a macro to run Ratio Profiler and save the results on a series of ROIs. It works beautifully on my Mac. However the Results table isn’t being saved properly on a PC. On PC, it is saved as a file of 0 KB. On Mac, I get a “.csv” file for each ROI, which is what I want. Any suggestions would be greatly appreciated. Here is the code for the Ratio_Profiler and saving part of the macro. Many thanks in advance.

//Draw and save ROI

roiManager("reset");
roiManager("show all");
waitForUser("Draw all desired ROIs and add to manager. Click OK when done.");

array1 = newArray("0");; 

for (i=1;i<roiManager("count");i++){ 

        array1 = Array.concat(array1,i); 

        Array.print(array1); 

} 

roiManager("select", array1); 
directory = getDirectory("image");
roiManager("Save", directory + title +"_ROI.zip")


//Run Ratio Profiler

for (i=0; i<roiManager("count"); i++){
    roiManager("select", i)
    
run("Ratio Profiler");

table = getInfo("window.title");
selectWindow(table);
dotIndex = indexOf(table, ".");
table = substring(table, 0, dotIndex); 
saveAs("Results", directory + table + "_" +i+ ".csv");
  
run("Close" );

selectWindow(binary);
close("\\Others");

}

close();
close("Log");

Hi @Tala_Kaplinovsky1,

Is the zip saved correctly on Windows ? The only thing that would explain that it’s working on mac and not windows would be an error in the path.

Could you try to print the result of directory + table + "_" + i + ".csv" ?