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 3027)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/CreateTheOtherTurns.groovy	(revision 3028)
@@ -15,7 +15,7 @@
 import java.util.Map.Entry
 import java.util.regex.Pattern
 
-class FixTranscription extends XMLProcessor {
+class CreateTheOtherTurns extends XMLProcessor {
 	
 	LocalNamesHookActivator activator;
 	IdentityHook hook;
@@ -27,18 +27,18 @@
 	
 	String otherNonPrimaryLocutor = "other"
 	
-	public FixTranscription(File xmlfile, String primarySpeakerIdPrefix, String otherNonPrimaryLocutor, Boolean debug) {
+	public CreateTheOtherTurns(File xmlfile, String primarySpeakerIdRegexString, String otherNonPrimaryLocutor, Boolean debug) {
 		super(xmlfile)
 		this.debug = debug
 		
 		this.otherNonPrimaryLocutor = otherNonPrimaryLocutor
-		if (primarySpeakerIdPrefix != null && primarySpeakerIdPrefix.length() > 0) {
+		if (primarySpeakerIdRegexString != null && primarySpeakerIdRegexString.length() > 0) {
 			String id = FileUtils.stripExtension(xmlfile)
 			
-			this.primarySpeakerIdRegex = /$primarySpeakerIdPrefix.*/
+			this.primarySpeakerIdRegex = /$primarySpeakerIdRegexString/
 			
 			def rez = (id =~ primarySpeakerIdRegex).findAll()
-			def rez2 = (id =~ /$primarySpeakerIdPrefix/).findAll()
+			def rez2 = (id =~ /$primarySpeakerIdRegex/).findAll()
 			if (rez2.size() != 1) {
 				if (debug) println "WARNING: found the ${rez2.size()} matches of primary speaker prefix in the '$id' file name"
 				this.primarySpeakerIdRegex = null
@@ -48,7 +48,7 @@
 			}
 		}
 		
-		activator = new LocalNamesHookActivator<>(hook, ["w", "Turn", "Sync"]);
+		activator = new LocalNamesHookActivator<>(hook, ["Speaker", "w", "Turn", "Sync"]);
 		
 		hook = new IdentityHook("word_hook", activator, this) {
 					
@@ -74,7 +74,13 @@
 					
 					@Override
 					protected void processStartElement() throws XMLStreamException, IOException {
-						if (localname.equals("Turn")) {
+						if (localname.equals("Speaker")) { // find out the main speaker
+							String id = parser.getAttributeValue(null, "id")// id
+							if (id ==~ primarySpeakerIdRegex) {
+								primarySpeakerId = id
+							}
+							super.processStartElement();
+						} else if (localname.equals("Turn")) {
 							// store values
 							inTurn = true;
 							turnInfos.clear()
@@ -130,8 +136,8 @@
 								for (String attr : turnInfos.keySet()) tmpInfos[attr] = turnInfos[attr]
 								tmpInfos["orig-speaker"] = turnInfos["speaker"]
 								
-								if (primarySpeakerIdRegex == null || turnInfos["speaker"] ==~ primarySpeakerIdRegex) {
-									tmpInfos["speaker"] = "other"
+								if (primarySpeakerIdRegex == null || turnInfos["speaker"] ==~ primarySpeakerIdRegex) { // the current speaker is not the primary speaker
+									tmpInfos["speaker"] = otherNonPrimaryLocutor
 								} 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 3027)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/PrepareTranscriptionsMacro.groovy	(revision 3028)
@@ -4,16 +4,17 @@
 import java.time.format.DateTimeFormatter
 import org.txm.utils.*
 import org.txm.utils.logger.*
-import org.txm.macro.transcriber.RenameSpeaker
+import org.txm.macro.transcription.RenameSpeaker
 
-@Field @Option(name="trsDirectory", usage="A Vocapia XML files directory to process", widget="Folder", required=false, def="")
-		File trsDirectory
+@Field @Option(name="vocapiaDirectory", usage="A Vocapia XML files directory to process", widget="Folder", required=false, def="")
+		File vocapiaDirectory
 
 @Field @Option(name="resultDirectory", usage="The result directory", widget="Folder", required=false, def="")
 		File resultDirectory
 		
-@Field @Option(name="primarySpeakerIdPrefix", usage="speaker ID of the primary speaker", widget="String", required=false, def="")
-		String primarySpeakerIdPrefix
+@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
 		
@@ -25,36 +26,36 @@
 		
 if (!ParametersDialog.open(this)) return;
 
-if (resultDirectory.equals(trsDirectory)) {
-	println "Result directory must differs from trsDirectory: "+trsDirectory
+if (resultDirectory.equals(vocapiaDirectory)) {
+	println "Result directory must differs from vocapiaDirectory: "+vocapiaDirectory
 	return false;
 }
 
 resultDirectory.mkdirs();
 
-def trsFiles = []
-	
-println "Processing TRS directory: $trsDirectory"
-for (File file : trsDirectory.listFiles()) {
-	if (file.getName().toLowerCase().endsWith(".trs")) {
-		trsFiles << file
-	}
-}
+println "PREPARING VOCAPIA FILES TO TRS FILES..."
+File trsDirectory = new File(resultDirectory, "vocapia2trs")
+trsDirectory.mkdir()
+gse.runMacro(org.txm.macro.transcription.Vocapia2TranscriberMacro, ["vocapiaDirectory":vocapiaDirectory, "resultDirectory":trsDirectory])
 
+
+
+trsFiles = trsDirectory.listFiles().findAll(){it.getName().toLowerCase().endsWith(".trs")}
 if (trsFiles.size() == 0) {
-	println "No XML file found for parameters trsDirectory=$trsDirectory"
+	println "No XML file found in $trsDirectory"
 	return false
 }
 
 println "CREATE THE 'OTHER' TURNS..."
-
+File otherDirectory = new File(resultDirectory, "otherturns")
+otherDirectory.mkdir()
 ConsoleProgressBar cpb = new ConsoleProgressBar(trsFiles.size())
 for (File file : trsFiles) {
 	cpb.tick()
 	
-	CreateTheOtherTurns fixer = new CreateTheOtherTurns(file, primarySpeakerIdPrefix, otherNonPrimaryLocutor, debug)
+	CreateTheOtherTurns fixer = new CreateTheOtherTurns(file, primarySpeakerIdRegex, otherNonPrimaryLocutor, debug)
 	String name = FileUtils.stripExtension(file)
-	File outFile = new File(resultDirectory, name+".trs")
+	File outFile = new File(otherDirectory, name+".trs")
 	
 	if (!fixer.process(outFile)) {
 		println "WARNING: ERROR WHILE PROCESSING: "+file
@@ -62,13 +63,20 @@
 }
 cpb.done()
 
+trsFiles = otherDirectory.listFiles().findAll(){it.getName().toLowerCase().endsWith(".trs")}
+if (trsFiles.size() == 0) {
+	println "No XML file found in $otherDirectory"
+	return false
+}
+
 // FIX LOCUTORS
 println "NORMALIZING LOCUTORS..."
 cpb = new ConsoleProgressBar(trsFiles.size())
-for (File file : resultDirectory.listFiles()) {
+for (File file : trsFiles) {
 	cpb.tick()
 	
-	RenameSpeaker fixer = new RenameSpeaker(file, file, nonPrimaryLocutorReplaceRegex, null, otherNonPrimaryLocutor, otherNonPrimaryLocutor)
+	File outFile = new File(resultDirectory, file.getName())
+	RenameSpeaker fixer = new RenameSpeaker(file, outFile, nonPrimaryLocutorReplaceRegex, null, otherNonPrimaryLocutor, otherNonPrimaryLocutor)
 	
 	if (!fixer.process()) {
 		println "WARNING: ERROR WHILE PROCESSING: "+file
@@ -76,4 +84,9 @@
 }
 cpb.done()
 
+if (!debug) {
+	otherDirectory.deleteDir()
+	trsDirectory.deleteDir()
+}
+
 println "Done: "+trsFiles.size()+" files processed. Result files in $resultDirectory"
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 3027)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/RenameSpeaker.groovy	(revision 3028)
@@ -18,7 +18,7 @@
 /** 
  * Renames speakers given an id or name regex
  **/
-public class ChangeSpeaker {
+public class RenameSpeaker {
 	File outfile, transcriptionfile
 	
 	/** The doc. */
@@ -35,7 +35,7 @@
 	 * @param id the id
 	 * @param newid the newid
 	 */
-	public ChangeSpeaker(File transcriptionfile, File outfile, String idRegexString, String nameRegexString, String newId, String newName) {
+	public RenameSpeaker(File transcriptionfile, File outfile, String idRegexString, String nameRegexString, String newId, String newName) {
 		
 		this.transcriptionfile = transcriptionfile
 		this.outfile = outfile;
@@ -93,7 +93,6 @@
 				}
 			}
 			
-			
 			def expr = XPathFactory.newInstance().newXPath().compile("//Turn");
 			def nodes = expr.evaluate(doc, XPathConstants.NODESET);
 			
