Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/CreateTheOtherTurns.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/CreateTheOtherTurns.groovy	(revision 3028)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/CreateTheOtherTurns.groovy	(revision 3029)
@@ -25,13 +25,13 @@
 	
 	Boolean debug
 	
-	String otherNonPrimaryLocutor = "other"
+	String otherNonPrimarySpeakerId = "other"
 	
-	public CreateTheOtherTurns(File xmlfile, String primarySpeakerIdRegexString, String otherNonPrimaryLocutor, Boolean debug) {
+	public CreateTheOtherTurns(File xmlfile, String primarySpeakerIdRegexString, String otherNonPrimarySpeakerId, Boolean debug) {
 		super(xmlfile)
 		this.debug = debug
 		
-		this.otherNonPrimaryLocutor = otherNonPrimaryLocutor
+		this.otherNonPrimarySpeakerId = otherNonPrimarySpeakerId
 		if (primarySpeakerIdRegexString != null && primarySpeakerIdRegexString.length() > 0) {
 			String id = FileUtils.stripExtension(xmlfile)
 			
@@ -137,7 +137,7 @@
 								tmpInfos["orig-speaker"] = turnInfos["speaker"]
 								
 								if (primarySpeakerIdRegex == null || turnInfos["speaker"] ==~ primarySpeakerIdRegex) { // the current speaker is not the primary speaker
-									tmpInfos["speaker"] = otherNonPrimaryLocutor
+									tmpInfos["speaker"] = otherNonPrimarySpeakerId
 								} else {
 									tmpInfos["speaker"] = primarySpeakerId
 								}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/PrepareTranscriptionsMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/PrepareTranscriptionsMacro.groovy	(revision 3028)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/PrepareTranscriptionsMacro.groovy	(revision 3029)
@@ -4,7 +4,7 @@
 import java.time.format.DateTimeFormatter
 import org.txm.utils.*
 import org.txm.utils.logger.*
-import org.txm.macro.transcription.RenameSpeaker
+import org.txm.macro.transcription.RecodeSpeakers
 
 @Field @Option(name="vocapiaDirectory", usage="A Vocapia XML files directory to process", widget="Folder", required=false, def="")
 		File vocapiaDirectory
@@ -15,11 +15,11 @@
 @Field @Option(name="primarySpeakerIdRegex", usage="speaker ID of the primary speaker", widget="String", required=false, def="")
 		String primarySpeakerIdRegex
 
-@Field @Option(name="otherNonPrimaryLocutor", usage="other non primary id of the other turns", widget="String", required=false, def="")
-		String otherNonPrimaryLocutor
+@Field @Option(name="otherNonPrimarySpeakerId", usage="other non primary id of the other turns", widget="String", required=false, def="")
+		String otherNonPrimarySpeakerId
 		
-@Field @Option(name="nonPrimaryLocutorReplaceRegex", usage="other non primary id of the other turns", widget="String", required=false, def="")
-		String nonPrimaryLocutorReplaceRegex
+@Field @Option(name="nonPrimarySpeakerRegex", usage="other non primary id of the other turns", widget="String", required=false, def="")
+		String nonPrimarySpeakerRegex
 
 @Field @Option(name="debug", usage="speaker ID of the primary speaker", widget="Boolean", required=false, def="false")
 		Boolean debug
@@ -53,7 +53,7 @@
 for (File file : trsFiles) {
 	cpb.tick()
 	
-	CreateTheOtherTurns fixer = new CreateTheOtherTurns(file, primarySpeakerIdRegex, otherNonPrimaryLocutor, debug)
+	CreateTheOtherTurns fixer = new CreateTheOtherTurns(file, primarySpeakerIdRegex, otherNonPrimarySpeakerId, debug)
 	String name = FileUtils.stripExtension(file)
 	File outFile = new File(otherDirectory, name+".trs")
 	
@@ -76,7 +76,7 @@
 	cpb.tick()
 	
 	File outFile = new File(resultDirectory, file.getName())
-	RenameSpeaker fixer = new RenameSpeaker(file, outFile, nonPrimaryLocutorReplaceRegex, null, otherNonPrimaryLocutor, otherNonPrimaryLocutor)
+	RecodeSpeakers fixer = new RecodeSpeakers(file, outFile, nonPrimarySpeakerRegex, null, otherNonPrimarySpeakerId, otherNonPrimarySpeakerId)
 	
 	if (!fixer.process()) {
 		println "WARNING: ERROR WHILE PROCESSING: "+file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RenameSpeakerFromDirectoryMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RenameSpeakerFromDirectoryMacro.groovy	(revision 3028)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RenameSpeakerFromDirectoryMacro.groovy	(revision 3029)
@@ -1,50 +0,0 @@
-package org.txm.macro.transcription
-
-import java.nio.charset.Charset
-
-import java.time.LocalTime
-import java.time.format.DateTimeFormatter
-import org.txm.utils.*
-import org.txm.utils.logger.*
-
-@Field @Option(name="trsDirectory", usage="Dossier qui contient les fichiers TRS", widget="Folder", required=true, def="")
-File trsDirectory;
-
-@Field @Option(name="outputTrsDirectory", usage="Dossier résultat qui contient les fichiers TRS", widget="Folder", required=true, def="")
-File outputTrsDirectory;
-
-@Field @Option(name="idRegex", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
-def idRegex
-
-@Field @Option(name="nameRegex", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
-def nameRegex
-
-@Field @Option(name="newID", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
-def newID
-
-@Field @Option(name="newName", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
-def newName
-
-def files = trsDirectory.listFiles()
-if (files == null) {
-	println "Error: no files in $trsDirectory"
-	return false
-}
-
-outputTrsDirectory.mkdirs()
-if (!outputTrsDirectory.exists()) {
-	println "Error: can't create $outputTrsDirectory"
-	return false;
-}
-
-boolean ok = true
-for (File trsFile : files) {
-	
-	if (!trsFile.getName().toLowerCase().endsWith(".trs")) continue;
-	
-	File outputTrsFile = new File(outputTrsDirectory, trsFile.getName());
-	
-	ok = ok && gse.runMacro(RenameSpeakerMacro, ["trsFile":trsFile, "outputTrsFile":outputTrsFile, "idRegex":idRegex, "nameRegex":nameRegex, "newID":newID, "newName":newName])
-}
-
-return ok
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RenameSpeaker.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RenameSpeaker.groovy	(revision 3028)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RenameSpeaker.groovy	(revision 3029)
@@ -1,148 +0,0 @@
-package org.txm.macro.transcription
-
-import org.txm.scripts.importer.*;
-import org.txm.utils.*;
-import org.txm.metadatas.*;
-
-import java.io.File;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import javax.xml.parsers.*;
-import javax.xml.xpath.*;
-import javax.xml.transform.*;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-/** 
- * Renames speakers given an id or name regex
- **/
-public class RenameSpeaker {
-	File outfile, transcriptionfile
-	
-	/** The doc. */
-	Document doc
-	
-	def idRegex, nameRegex
-	String newId, newName
-	
-	/**
-	 * Instantiates a new change speaker.
-	 *
-	 * @param transcriptionfile the transcriptionfile
-	 * @param outfile the outfile
-	 * @param id the id
-	 * @param newid the newid
-	 */
-	public RenameSpeaker(File transcriptionfile, File outfile, String idRegexString, String nameRegexString, String newId, String newName) {
-		
-		this.transcriptionfile = transcriptionfile
-		this.outfile = outfile;
-		
-		if (idRegexString != null && idRegexString.length() > 0) {
-			this.idRegex = /$idRegexString/
-		}
-		if (nameRegexString != null && nameRegexString.length() > 0) {
-			this.nameRegex = /$nameRegexString/
-		}
-		this.newId = newId
-		this.newName = newName
-	}
-	
-	/**
-	 * Save.
-	 *
-	 * @return true, if successful
-	 */
-	public boolean process() {
-		try {
-			DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
-			domFactory.setNamespaceAware(true); // never forget this!
-			domFactory.setXIncludeAware(true);
-			DocumentBuilder builder = domFactory.newDocumentBuilder();
-			doc = builder.parse(transcriptionfile);
-			
-			def expr2 = XPathFactory.newInstance().newXPath().compile("//Speaker");
-			def nodes2 = expr2.evaluate(doc, XPathConstants.NODESET);
-			
-			// fix speaker declarations
-			def replacedIds = [] // list of IDs replaced, the list is used later to update the Turn locutors ids
-			
-			for (def node : nodes2) {
-				if (node == null) continue;
-				Element elem = (Element)node;
-				
-				String id = elem.getAttribute("id")
-				String name = elem.getAttribute("name")
-				
-				if (idRegex != null && id =~ idRegex) { // patch Speaker@id
-					if (newId != null) {
-						elem.setAttribute("id", newId);
-						replacedIds << id
-					}
-					if (newName != null) {
-						elem.setAttribute("name", newName);
-					}
-				}
-				
-				if (nameRegex != null && id =~ nameRegex) { // patch Speaker@name
-					if (newName != null) {
-						elem.setAttribute("name", newName);
-					}
-				}
-			}
-			
-			def expr = XPathFactory.newInstance().newXPath().compile("//Turn");
-			def nodes = expr.evaluate(doc, XPathConstants.NODESET);
-			
-			// fix speaker turns
-			
-			for (def node : nodes) {
-				if (node == null) continue;
-				
-				Element elem = (Element)node;
-				String id = elem.getAttribute("speaker");
-				
-				if (replacedIds.contains(id)) {
-					elem.setAttribute("speaker", newId);
-				}
-			}
-			
-			// Création de la source DOM
-			Source source = new DOMSource(doc);
-			
-			// Création du fichier de sortie
-			Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8"));
-			Result resultat = new StreamResult(writer);
-			
-			// Configuration du transformer
-			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
-			Transformer transformer = fabrique.newTransformer();
-			transformer.setOutputProperty(OutputKeys.METHOD, "xml");
-			transformer.setOutputProperty(OutputKeys.INDENT, "yes");
-			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
-			
-			// Transformation
-			transformer.transform(source, resultat);
-			writer.close();
-			return true;
-		} catch (Exception e) {
-			org.txm.utils.logger.Log.printStackTrace(e);
-			return false;
-		}
-	}
-	
-	/**
-	 * The main method.
-	 *
-	 * @param args the arguments
-	 */
-	public static void main(String[] args) {
-		String homedir = System.getProperty("user.home")
-		File trs1 = new File(homedir, "xml/concattrs/int18_1.trs")
-		File trs2 = new File(homedir, "xml/concattrs/int18_1-renamed.trs")
-		
-		new RenameSpeaker(trs1, trs2, "spk2", null, "spk4", null).process();
-	}
-}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RenameSpeakerMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RenameSpeakerMacro.groovy	(revision 3028)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RenameSpeakerMacro.groovy	(revision 3029)
@@ -1,31 +0,0 @@
-package org.txm.macro.transcription
-
-import java.nio.charset.Charset
-
-import java.time.LocalTime
-import java.time.format.DateTimeFormatter
-import org.txm.utils.*
-import org.txm.utils.logger.*
-
-@Field @Option(name="trsFile", usage="Dossier qui contient les fichiers TRS", widget="FileOpen", required=true, def="")
-File trsFile;
-
-@Field @Option(name="outputTrsFile", usage="Dossier qui contient les fichiers TRS", widget="FileSave", required=true, def="")
-File outputTrsFile;
-
-@Field @Option(name="idRegex", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
-def idRegex
-
-@Field @Option(name="nameRegex", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
-def nameRegex
-
-@Field @Option(name="idRegex", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
-def newID
-
-@Field @Option(name="nameRegex", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
-def newName
-
-
-def cs = new RenameSpeaker(trsFile, outputTrsFile, idRegex, nameRegex, newID, newName);
-
-return cs.process();
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RecodeSpeakersFromDirectoryMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RecodeSpeakersFromDirectoryMacro.groovy	(revision 0)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RecodeSpeakersFromDirectoryMacro.groovy	(revision 3029)
@@ -0,0 +1,50 @@
+package org.txm.macro.transcription
+
+import java.nio.charset.Charset
+
+import java.time.LocalTime
+import java.time.format.DateTimeFormatter
+import org.txm.utils.*
+import org.txm.utils.logger.*
+
+@Field @Option(name="trsDirectory", usage="Dossier qui contient les fichiers TRS", widget="Folder", required=true, def="")
+File trsDirectory;
+
+@Field @Option(name="outputTrsDirectory", usage="Dossier résultat qui contient les fichiers TRS", widget="Folder", required=true, def="")
+File outputTrsDirectory;
+
+@Field @Option(name="idRegex", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
+def idRegex
+
+@Field @Option(name="nameRegex", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
+def nameRegex
+
+@Field @Option(name="newID", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
+def newID
+
+@Field @Option(name="newName", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
+def newName
+
+def files = trsDirectory.listFiles()
+if (files == null) {
+	println "Error: no files in $trsDirectory"
+	return false
+}
+
+outputTrsDirectory.mkdirs()
+if (!outputTrsDirectory.exists()) {
+	println "Error: can't create $outputTrsDirectory"
+	return false;
+}
+
+boolean ok = true
+for (File trsFile : files) {
+	
+	if (!trsFile.getName().toLowerCase().endsWith(".trs")) continue;
+	
+	File outputTrsFile = new File(outputTrsDirectory, trsFile.getName());
+	
+	ok = ok && gse.runMacro(RecodeSpeakersMacro, ["trsFile":trsFile, "outputTrsFile":outputTrsFile, "idRegex":idRegex, "nameRegex":nameRegex, "newID":newID, "newName":newName])
+}
+
+return ok
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RecodeSpeakers.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RecodeSpeakers.groovy	(revision 0)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RecodeSpeakers.groovy	(revision 3029)
@@ -0,0 +1,148 @@
+package org.txm.macro.transcription
+
+import org.txm.scripts.importer.*;
+import org.txm.utils.*;
+import org.txm.metadatas.*;
+
+import java.io.File;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.xml.parsers.*;
+import javax.xml.xpath.*;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+/** 
+ * Renames speakers given an id or name regex
+ **/
+public class RecodeSpeakers {
+	File outfile, transcriptionfile
+	
+	/** The doc. */
+	Document doc
+	
+	def idRegex, nameRegex
+	String newId, newName
+	
+	/**
+	 * Instantiates a new change speaker.
+	 *
+	 * @param transcriptionfile the transcriptionfile
+	 * @param outfile the outfile
+	 * @param id the id
+	 * @param newid the newid
+	 */
+	public RecodeSpeakers(File transcriptionfile, File outfile, String idRegexString, String nameRegexString, String newId, String newName) {
+		
+		this.transcriptionfile = transcriptionfile
+		this.outfile = outfile;
+		
+		if (idRegexString != null && idRegexString.length() > 0) {
+			this.idRegex = /$idRegexString/
+		}
+		if (nameRegexString != null && nameRegexString.length() > 0) {
+			this.nameRegex = /$nameRegexString/
+		}
+		this.newId = newId
+		this.newName = newName
+	}
+	
+	/**
+	 * Save.
+	 *
+	 * @return true, if successful
+	 */
+	public boolean process() {
+		try {
+			DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+			domFactory.setNamespaceAware(true); // never forget this!
+			domFactory.setXIncludeAware(true);
+			DocumentBuilder builder = domFactory.newDocumentBuilder();
+			doc = builder.parse(transcriptionfile);
+			
+			def expr2 = XPathFactory.newInstance().newXPath().compile("//Speaker");
+			def nodes2 = expr2.evaluate(doc, XPathConstants.NODESET);
+			
+			// fix speaker declarations
+			def replacedIds = [] // list of IDs replaced, the list is used later to update the Turn locutors ids
+			
+			for (def node : nodes2) {
+				if (node == null) continue;
+				Element elem = (Element)node;
+				
+				String id = elem.getAttribute("id")
+				String name = elem.getAttribute("name")
+				
+				if (idRegex != null && id =~ idRegex) { // patch Speaker@id
+					if (newId != null) {
+						elem.setAttribute("id", newId);
+						replacedIds << id
+					}
+					if (newName != null) {
+						elem.setAttribute("name", newName);
+					}
+				}
+				
+				if (nameRegex != null && id =~ nameRegex) { // patch Speaker@name
+					if (newName != null) {
+						elem.setAttribute("name", newName);
+					}
+				}
+			}
+			
+			def expr = XPathFactory.newInstance().newXPath().compile("//Turn");
+			def nodes = expr.evaluate(doc, XPathConstants.NODESET);
+			
+			// fix speaker turns
+			
+			for (def node : nodes) {
+				if (node == null) continue;
+				
+				Element elem = (Element)node;
+				String id = elem.getAttribute("speaker");
+				
+				if (replacedIds.contains(id)) {
+					elem.setAttribute("speaker", newId);
+				}
+			}
+			
+			// Création de la source DOM
+			Source source = new DOMSource(doc);
+			
+			// Création du fichier de sortie
+			Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8"));
+			Result resultat = new StreamResult(writer);
+			
+			// Configuration du transformer
+			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
+			Transformer transformer = fabrique.newTransformer();
+			transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+			
+			// Transformation
+			transformer.transform(source, resultat);
+			writer.close();
+			return true;
+		} catch (Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return false;
+		}
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+		String homedir = System.getProperty("user.home")
+		File trs1 = new File(homedir, "xml/concattrs/int18_1.trs")
+		File trs2 = new File(homedir, "xml/concattrs/int18_1-renamed.trs")
+		
+		new RecodeSpeakers(trs1, trs2, "spk2", null, "spk4", null).process();
+	}
+}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RecodeSpeakersMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RecodeSpeakersMacro.groovy	(revision 0)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RecodeSpeakersMacro.groovy	(revision 3029)
@@ -0,0 +1,31 @@
+package org.txm.macro.transcription
+
+import java.nio.charset.Charset
+
+import java.time.LocalTime
+import java.time.format.DateTimeFormatter
+import org.txm.utils.*
+import org.txm.utils.logger.*
+
+@Field @Option(name="trsFile", usage="Dossier qui contient les fichiers TRS", widget="FileOpen", required=true, def="")
+File trsFile;
+
+@Field @Option(name="outputTrsFile", usage="Dossier qui contient les fichiers TRS", widget="FileSave", required=true, def="")
+File outputTrsFile;
+
+@Field @Option(name="idRegex", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
+def idRegex
+
+@Field @Option(name="nameRegex", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
+def nameRegex
+
+@Field @Option(name="idRegex", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
+def newID
+
+@Field @Option(name="nameRegex", usage="Colonne de jointure de transcription", widget="String", required=true, def="")
+def newName
+
+
+def cs = new RecodeSpeakers(trsFile, outputTrsFile, idRegex, nameRegex, newID, newName);
+
+return cs.process();
\ No newline at end of file
