Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/office/MergeExcelDirMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/office/MergeExcelDirMacro.groovy	(revision 2029)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/office/MergeExcelDirMacro.groovy	(revision 2030)
@@ -1,3 +1,7 @@
+// Copyright © 2019 ENS de Lyon, CNRS, University of Franche-Comté
+// @author mdecorde
+// @author sheiden
+
 package org.txm.macro.office
 
 import org.kohsuke.args4j.*
@@ -13,33 +17,35 @@
 import org.apache.poi.xssf.usermodel.*
 import org.apache.poi.ss.util.*
 
-@Field @Option(name="inputDirectory", usage="répertoire des fichiers Excel à traiter", widget="Folder", required=true, def="")
+@Field @Option(name="inputDirectory", usage="répertoire des fichiers Excel à fusionner", widget="Folder", required=true, def="")
 		def inputDirectory
 
-@Field @Option(name="outputFile", usage="output file", widget="File", required=true, def="")
+@Field @Option(name="outputFile", usage="output file", widget="FileSave", required=true, def="")
 		def outputFile
 
 @Field @Option(name="sheetName", usage="sheet name (if no name is given the first sheet will be used)", widget="String", required=false, def="")
 		def sheetName
 
-@Field @Option(name="columnList", usage="column list to extract, separated with comma", widget="String", required=false, def="")
+@Field @Option(name="columnList", usage="list of columns to extract, separated by comma", widget="String", required=false, def="")
 		def columnList
 
-if (!ParametersDialog.open(this)) return
+if (!ParametersDialog.open(this)) return false
 
-	if (!inputDirectory.exists()) {
-		println "** $scriptName: no '"+inputDirectory.name+"' directory found. Aborting."
-		return false
-	}
+if (!inputDirectory.exists()) {
+	println "** $scriptName: no '"+inputDirectory.name+"' directory found. Aborting."
+	return false
+}
 
 if (!inputDirectory.canRead()) {
 	println "** $scriptName: '"+inputDirectory.name+"' directory not readable. Aborting."
 	return false
 }
 
+def aborted = false
+
 def scriptName = this.class.getSimpleName()
 
-columnList = columnList.split("\t")
+columnList = columnList.split(",")
 
 println "columnList = "+columnList
 
@@ -49,7 +55,7 @@
 finalSheet = wb.createSheet()
 
 // create header line
-int nFinalRows = 1
+nFinalRows = 1
 r = finalSheet.createRow(0)
 columnList.eachWithIndex { columnName, i ->
 	c = r.createCell(i)
@@ -58,78 +64,91 @@
 
 def f = []
 
-inputDirectory.eachFileMatch(~/.*xlsx/) { f << it }
+inputDirectory.eachFileMatch(~/.*\.xlsx/) { f << it }
 
 if (f.size() == 0) {
 	println "** $scriptName: no .xlsx file found. Aborting."
 	return false
 }
-debug = false;
-ConsoleProgressBar cpb = new ConsoleProgressBar(f.size())
+
+debug = false
+//ConsoleProgressBar cpb = new ConsoleProgressBar(f.size())
 try {
 
 	f.sort { it.name }.each { inputFile ->
 
 		if (debug) println "Processing "+inputFile+"."
-		cpb.tick()
+		//cpb.tick()
 		rownum = 0
 
-		// open input stylesheet
-		Workbook wb2 = WorkbookFactory.create(inputFile)
-		Sheet ws = null;
+		// open input sheet
+		wb2 = WorkbookFactory.create(inputFile)
+		ws = null
 		if (sheetName.length() == 0) {
 			ws = wb2.getSheetAt(0)
 		} else {
 			ws = wb2.getSheet(sheetName)
 			if (ws == null) {
-				println "** Excel2XML: no '"+sheetName+" found. Aborting."
+				println "** $scriptName: no '"+sheetName+" found. Aborting."
+				aborted = true
 				return false
 			}
 		}
 
 		if (ws == null) {
 			println "** $scriptName: no sheet found. Aborting."
+			aborted = true
 			return false
 		}
 
 		nRows = ws.getPhysicalNumberOfRows()
 		if (debug) println nRows+" rows."
 
-		Row firstRow = ws.getRow(0) // get header line
-		int nCells = firstRow.getPhysicalNumberOfCells()
+		firstRow = ws.getRow(0)
+		nCells = firstRow.getPhysicalNumberOfCells()
 		def cellIndexes = []
-		for (int iCell = 0 ; iCell < nCells ; iCell++) { // get indexes of columns to copy
-			String value = firstRow.getCell(iCell).getStringCellValue()
+		0.upto(nCells-1, { iCell ->
+			value = firstRow.getCell(iCell).getStringCellValue()
 			if (columnList.contains(value)) {
 				cellIndexes << iCell
 			}
+		})
+
+		if (cellIndexes.size() != columnList.size()) {
+			println "** $scriptName: some columns missing in file $inputFile. Aborting."
+			aborted = true
+			return false
 		}
-		
-		for (int iRow = 1 ; iRow < nRows ; iRow++) { // copy rows from next lines
-			Row row = ws.getRow(iRow)
+
+		1.upto(nRows-1, { iRow ->
+			row = ws.getRow(iRow)
 			r = finalSheet.createRow(nFinalRows)
 			
-			int nCellCreated = 0
-			for (int iCell : cellIndexes) {
-				String value = row.getCell(iCell).getStringCellValue()
-				Cell c = r.createCell(nCellCreated)
+			nCellCreated = 0
+			cellIndexes.each { iCell ->
+				value = row.getCell(iCell).getStringCellValue()
+				c = r.createCell(nCellCreated)
 				c.setCellValue(value)
 				nCellCreated++
 			}
 			
 			nFinalRows++
-		}
+		})
 	}
 } catch(Exception e) {
-	return false;
+	aborted = true
+	return false
 }
-cpb.done();
+//cpb.done()
 
 /* write sheet */
 
 wb.write(out)
 out.close()
 
+if (aborted) return false
+
 println nFinalRows+" rows written."
 
 return true
+
Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GSERunner.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GSERunner.java	(revision 2029)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GSERunner.java	(revision 2030)
@@ -70,7 +70,7 @@
 
 		String[] roots = new String[] { 
 				rootDir.getAbsolutePath()+"/user/", //$NON-NLS-1$
-				rootDir.getAbsolutePath()+"/system/", //$NON-NLS-1$
+				//rootDir.getAbsolutePath()+"/system/", //$NON-NLS-1$
 		}; 
 
 		try {
