Ok, so the confusion seems to be because the macro has a mix of the macro extensions (using the API indexing to get the series count for example) and then using run(“Bio-Formats Importer”, which uses the values from the user interface. It is still valid to do this and your updated macro would then be something like below. If its helpful there are also some examples of using either method to convert to tif at https://github.com/ome/bioformats/tree/develop/components/bio-formats-plugins/utils/macros:
setBatchMode(true);
fs=File.separator;
pathFile=File.openDialog("Select LIF File to Process");
dirFiles=File.getDirectory(pathFile);
allFiles=getFileList(dirFiles);
print(allFiles.length);
for(f=0; f<allFiles.length; f++) {
if (endsWith(allFiles[f], ".lif"))
fileName=allFiles[f];
folderName=substring(fileName,0,lastIndexOf(fileName, "."));
condName=folderName;
dirPath= File.getParent(pathFile)+fs;
savePath=dirPath + folderName + fs;
run("Bio-Formats Macro Extensions");
Ext.setId(dirFiles+fileName);
Ext.getSeriesCount(seriesCount);
sCount=seriesCount;
for(l=1;l<=sCount;l++){
run("Bio-Formats Importer", "open=["+dirPath+fileName+"] autoscale color_mode=Default view=Hyperstack stack_order=XYCZT series_"+(l));
nameStore=getTitle();
getDateAndTime(year, month, dayOfWeek, dayOfMonth, hour, minute, second, msec);
print(hour+":"+minute+":"+second+" - Processing Series "+(l)+" of "+seriesCount);
//imageName=getInfo("image.filename");
currentCount=l+1;
currentCount=d2s(currentCount,0);
currentLength=lengthOf(currentCount);
if(currentLength==1){
folderPath= condName+"-00"+currentCount+fs;
}
if(currentLength==2){
folderPath= condName+"-0"+currentCount+fs;
}
if(currentLength>=3){
folderPath= condName+currentCount+fs;
}
fullsave=savePath+folderPath;
run("8-bit");
print(folderPath);
print(fullsave);
//Ext.setId(fullsave);
run("Image Sequence... ","format=TIFF save=["+fullsave+"] name=["+condName+"]-");
run("Close All");
}
}
print("DONE!");
//dir="+savePath+folderPath+"
//dir=["+fullsave+"]
//] name=["+ condName + "-]