OutFoldCSV("~/Desktop",app.activeDocument.name); replaces the layers names in the xls with the document name.
When placed before the first if statement it prints the document name before each layer name in the xls.
OutFoldCSV("~/Desktop",app.activeDocument.name); replaces the layers names in the xls with the document name.
When placed before the first if statement it prints the document name before each layer name in the xls.