Index: TXM/trunk/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java
===================================================================
--- TXM/trunk/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java	(revision 3422)
+++ TXM/trunk/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java	(revision 3423)
@@ -6,8 +6,10 @@
 import java.util.List;
 
 import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.TableViewerColumn;
@@ -16,6 +18,8 @@
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.KeyEvent;
 import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
@@ -224,6 +228,26 @@
 			}
 		});
 		
+		table.addMouseListener(new MouseListener() {
+			
+			@Override
+			public void mouseUp(MouseEvent e) { }
+			
+			@Override
+			public void mouseDown(MouseEvent e) { }
+			
+			@Override
+			public void mouseDoubleClick(MouseEvent e) {
+				
+//				ISelection selection = viewer.getSelection();
+//				if (selection.isEmpty()) return;
+//				
+//				IStructuredSelection sselection = (IStructuredSelection) selection;
+//				Object first = sselection.getFirstElement();
+//				System.out.println("First="+first);
+			}
+		});
+		
 		// Register the context menu
 		TXMEditor.initContextMenu(this.viewer.getTable(), this.getSite(), this.viewer);
 		
Index: TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/URSToolsMenuContribution.java
===================================================================
--- TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/URSToolsMenuContribution.java	(revision 3422)
+++ TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/URSToolsMenuContribution.java	(revision 3423)
@@ -139,7 +139,7 @@
 		public void widgetSelected(SelectionEvent e) {
 			IWorkbenchWindow acWindow = TXMWindows.getActiveWindow();
 			IWorkbenchPart page = acWindow.getActivePage().getActivePart();
-			ExecuteGroovyMacro.execute(macro.getAbsolutePath(), page, CorporaView.getInstance().getTreeViewer().getSelection(), "");
+			ExecuteGroovyMacro.execute(macro.getAbsolutePath(), page, CorporaView.getInstance().getTreeViewer().getSelection(), "", null);
 		}
 	}
 
Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/ImportWordPropertiesFromTableMacro.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/ImportWordPropertiesFromTableMacro.groovy	(revision 3422)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/ImportWordPropertiesFromTableMacro.groovy	(revision 3423)
@@ -11,95 +11,30 @@
 
 import org.txm.rcp.swt.widget.parameters.*
 
-@Field @Option(name="inputDirectory", usage="The XML-TXM folder", widget="Folder", required=true, def="")
-def inputDirectory = new File(System.getProperty("user.home"), "xml/anapovoas/HELPTXM-02-131124/ite02")
+@Field @Option(name="tsvFile", usage="The annotation TSV file", widget="FileOpen", required=true, def="")
+def tsvFile
 
-@Field @Option(name="outputDirectory", usage="The result folder", widget="Folder", required=true, def="")
-def outputDirectory = new File(System.getProperty("user.home"), "xml/anapovoas/HELPTXM-02-131124/ite03")
-
-@Field @Option(name="tsvFile", usage="The annotation TSV file", widget="File", required=true, def="")
-def tsvFile = new File(System.getProperty("user.home"), "xml/anapovoas/HELPTXM-02-131124/TSV-ITE02.csv")
-
 @Field @Option(name="properties", usage="columns to inject separated by commas", widget="String", required=true, def="p1, p2, ... , pn")
-def properties = "verificado"
+def properties
 
-@Field @Option(name="debug", usage="Debug de the macro", widget="Boolean", required=true, def="false")
-def debug = true
+@Field @Option(name="debug", usage="Debug de the macro", widget="Boolean", required=false, def="false")
+def debug
 
 if (!ParametersDialog.open(this)) return;
 
-def split = properties.split(",")
-if (split.length == 0) {
-	println "ERROR: no property given"
-	return false
-}
-properties = []
-for (def p : split) properties << p.trim()
+println "Importing the $properties properties in the $selection corpus"
+println "selection="+selection
+println "sel class="+selection.getClass()
+println "sel project="+selection.getParent()
+println "sel name="+selection.getName()
 
-println "Injecting annotations with the following parameters:"
-println "- inputDirectory: $inputDirectory"
-println "- outputDirectory: $outputDirectory"
-println "- tsvFile: $tsvFile"
-println "- properties: $properties"
+File inputDirectory = new File(selection.getParent().getProjectDirectory(), "txm/"+selection.getName())
 
-outputDirectory.mkdir()
-if (!outputDirectory.exists()) {
-	println "ERROR: could not create or read $outputDirectory directory"
-	return false
-}
+// insert the section in the TRS files
+gse.runMacro(InjectWordPropTableMacro, ["inputDirectory": inputDirectory
+	, "outputDirectory": inputDirectory
+	, "tsvFile": tsvFile
+	, "properties": properties
+	, "debug":debug])
 
-CsvReader records = new CsvReader(tsvFile.getAbsolutePath(), "\t".charAt(0), Charset.forName("UTF-8"))
-records.setTextQualifier((char)0)
-records.readHeaders();
-
-def header = Arrays.asList(records.getHeaders())
-if (debug) println "CSV header: $header"
-for (def s : properties) if (!header.contains(s)) {
-	println "Missing annotation property : $s"
-	return;
-}
-for (def s : ["text_id", "id"]) if (!header.contains(s)) {
-	println "Missing annotation property : $s"
-	return;
-}
-
-def injections = [:]
-int no = 1;
-while (records.readRecord()) {
-	String textid = records.get("text_id")
-	if (!injections.containsKey(textid)) injections[textid] = [:]
-	
-	def props = [:]
-	for (def s : properties) props[s] = records.get(s)
-	if (records.get("id") == "") {
-		 print "ERROR in record "+no
-	} else {
-		injections[textid][records.get("id")] = props
-	}
-	no++;
-}
-
-println "Injecting..."
-//for (String textid : injections.keySet()) {
-for (File currentXMLFile : inputDirectory.listFiles().sort{ it.name }) {
-	if (currentXMLFile.isDirectory()) continue;
-	if (currentXMLFile.isHidden()) continue;
-	
-	String textid = currentXMLFile.getName();
-	int idx = textid.lastIndexOf(".")
-	if (idx > 0) textid = textid.substring(0, idx);
-	
-	if (injections.containsKey(textid)) {	
-		if (debug) println "Injections of "+injections[textid].size()+" lines."
-		
-		def builder = new AnnotationInjectionFilter(currentXMLFile, injections[textid], properties, debug)
-		println "injecting in $currentXMLFile $properties"
-		builder.process(new File(outputDirectory, currentXMLFile.getName()));
-		println ""+builder.n+" lines injected."
-	} else {
-		println "copying file $currentXMLFile"
-		FileCopy.copy(currentXMLFile, new File(outputDirectory, currentXMLFile.getName()))
-	}
-}
-
-println "New XML-TXM files are saved in ${outputDirectory}."
\ No newline at end of file
+org.txm.rcp.commands.workspace.UpdateCorpus.update(selection, false)
\ No newline at end of file
Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/InjectWordPropTableMacro.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/InjectWordPropTableMacro.groovy	(revision 0)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/InjectWordPropTableMacro.groovy	(revision 3423)
@@ -0,0 +1,118 @@
+package org.txm.macro.annotation;
+
+import org.txm.utils.*
+import org.txm.utils.io.*
+
+import java.nio.charset.Charset
+
+import org.kohsuke.args4j.*
+
+import groovy.transform.Field
+
+import org.txm.rcp.swt.widget.parameters.*
+
+@Field @Option(name="inputDirectory", usage="The XML-TXM folder", widget="Folder", required=true, def="")
+def inputDirectory
+
+@Field @Option(name="outputDirectory", usage="The result folder", widget="Folder", required=true, def="")
+def outputDirectory
+
+@Field @Option(name="tsvFile", usage="The annotation TSV file", widget="FileOpen", required=true, def="")
+def tsvFile
+
+@Field @Option(name="properties", usage="columns to inject separated by commas", widget="String", required=true, def="p1, p2, ... , pn")
+def properties
+
+@Field @Option(name="debug", usage="Debug de the macro", widget="Boolean", required=false, def="false")
+def debug
+
+if (!ParametersDialog.open(this)) return;
+
+def split = properties.split(",")
+if (split.length == 0) {
+	println "ERROR: no property given"
+	return false
+}
+properties = []
+for (def p : split) properties << p.trim()
+
+println "Injecting annotations with the following parameters:"
+println "- inputDirectory: $inputDirectory"
+println "- outputDirectory: $outputDirectory"
+println "- tsvFile: $tsvFile"
+println "- properties: $properties"
+
+outputDirectory.mkdir()
+if (!outputDirectory.exists()) {
+	println "ERROR: could not create or read $outputDirectory directory"
+	return false
+}
+
+CsvReader records = new CsvReader(tsvFile.getAbsolutePath(), "\t".charAt(0), Charset.forName("UTF-8"))
+records.setTextQualifier((char)0)
+records.readHeaders();
+
+def header = Arrays.asList(records.getHeaders())
+if (debug) println "CSV header: $header"
+for (def s : properties) if (!header.contains(s)) {
+	println "Missing annotation property : $s"
+	return;
+}
+for (def s : ["text_id", "id"]) if (!header.contains(s)) {
+	println "Missing annotation property : $s"
+	return;
+}
+
+def injections = [:]
+int no = 1;
+while (records.readRecord()) {
+	String textid = records.get("text_id")
+	if (!injections.containsKey(textid)) injections[textid] = [:]
+	
+	def props = [:]
+	for (def s : properties) props[s] = records.get(s)
+	if (records.get("id") == "") {
+		 print "ERROR in record "+no
+	} else {
+		injections[textid][records.get("id")] = props
+	}
+	no++;
+}
+
+println "Injecting..."
+//for (String textid : injections.keySet()) {
+for (File currentXMLFile : inputDirectory.listFiles().sort{ it.name }) {
+	if (currentXMLFile.isDirectory()) continue;
+	if (currentXMLFile.isHidden()) continue;
+	
+	String textid = currentXMLFile.getName();
+	int idx = textid.lastIndexOf(".")
+	if (idx > 0) textid = textid.substring(0, idx);
+	
+	if (injections.containsKey(textid)) {
+		if (debug) println "Injections of "+injections[textid].size()+" lines."
+		File tmp = null
+		String filename = currentXMLFile.getName()
+		if (outputDirectory.equals(inputDirectory)) {
+			
+			tmp = File.createTempFile("tmp", currentXMLFile.getName())
+			FileCopy.copy(currentXMLFile, tmp)
+			//println "Patching input: $currentXMLFile with $tmp"
+			currentXMLFile = tmp;
+		}
+		def builder = new AnnotationInjectionFilter(currentXMLFile, injections[textid], properties, debug)
+		println "injecting in $currentXMLFile $properties"
+		builder.process(new File(outputDirectory, filename));
+		
+		if (tmp != null) tmp.delete(); // tmp != null if inputdir == outputir
+		
+		println ""+builder.n+" lines injected."
+	} else {
+		if (!outputDirectory.equals(inputDirectory)) {
+			println "copying file $currentXMLFile"
+			FileCopy.copy(currentXMLFile, new File(outputDirectory, currentXMLFile.getName()))
+		}
+	}
+}
+
+println "New XML-TXM files are saved in ${outputDirectory}."
\ No newline at end of file
Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/BuildWordPropTableMacro.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/BuildWordPropTableMacro.groovy	(revision 0)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/BuildWordPropTableMacro.groovy	(revision 3423)
@@ -0,0 +1,188 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+// $LastChangedDate: 2012-10-15 17:35:36 +0200 (lun., 15 oct. 2012) $
+// $LastChangedRevision: 2279 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.macro.annotation
+
+import org.txm.Toolbox
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.*
+import org.txm.concordance.core.functions.Concordance
+import org.txm.concordance.core.functions.Line
+import org.txm.functions.concordances.*
+import org.txm.functions.concordances.comparators.*
+import org.txm.searchengine.cqp.ReferencePattern
+
+import java.util.List
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcp.swt.widget.parameters.*
+
+if (!(corpusViewSelection instanceof CQPCorpus)) {
+	println "Error: you must select a corpus or a subcorpus to export properties"
+	return false;
+}
+
+CQPCorpus corpus = corpusViewSelection
+
+
+@Field @Option(name="properties", usage="columns to inject separated by commas", widget="String", required=true, def="p1, p2, ... , pn")
+		def properties
+
+@Field @Option(name="query", usage="The query to select words to annotate", widget="Query", required=true, def="[]")
+		def query
+
+@Field @Option(name="leftcontextsize", usage="The context sizes", widget="Integer", required=true, def="10")
+		def leftcontextsize
+
+@Field @Option(name="rightcontextsize", usage="The context sizes", widget="Integer", required=true, def="10")
+		def rightcontextsize
+
+@Field @Option(name="references", usage="references to show", widget="String", required=true, def="text_id")
+		def references
+
+@Field @Option(name="tsvFile", usage="The result TSV file", widget="FileSave", required=true, def="export.tsv")
+		def tsvFile
+
+if (!ParametersDialog.open(this)) return;
+
+def split = properties.split(",")
+if (split.length == 0) {
+	println "ERROR: no property given"
+	return false
+}
+properties = []
+for (def p : split) properties << p.trim()
+
+println "Building Annotation Table with the following parameters: "
+println "- corpus: $corpus"
+println "- query: $query"
+println "- annotation properties: $properties"
+println "- references: $properties"
+println "- TSV file: $tsvFile"
+
+tsvFile = tsvFile.getAbsoluteFile()
+if (!tsvFile.getParentFile().canWrite()) {
+	println "Error: "+tsvFile.getParentFile()+" is not writable."
+	return;
+}
+
+def annots = []
+for (def p : properties) {
+	def prop = corpus.getProperty(p)
+	if (prop == null) {
+		println "No such property $p in the $corpus corpus"
+		return false;
+	}
+	annots << prop
+}
+def id = corpus.getProperty("id")
+def word = corpus.getProperty("word")
+def text = corpus.getStructuralUnit("text")
+def text_id = text.getProperty("id")
+def refs = references.split(",")
+
+if (annots == null || annots.size() == 0) {
+	println "No such property given"//$annots in the $corpus corpus"
+	return false;
+}
+
+println "Exporting ..."
+def start = System.currentTimeMillis()
+
+// define the references pattern for each concordance line
+def referencePattern = new ReferencePattern()
+referencePattern.addProperty(text_id)
+referencePattern.addProperty(id)
+for (def annot : annots) referencePattern.addProperty(annot)
+
+def refProperties = []
+for (def ref : refs) {
+	ref = ref.trim()
+	try {
+		if (ref.contains("_")) {
+			def split2 = ref.split("_",2)
+			def refp = corpus.getStructuralUnit(split2[0].trim()).getProperty(split2[1].trim())
+			if (ref != "text_id")
+				referencePattern.addProperty(refp)
+			refProperties << refp
+		} else {
+			def p = corpus.getProperty(ref)
+			if (p != null) referencePattern.addProperty(p)
+		}
+	} catch(Exception e) { println "Error while parsing references: "+ref+" "+e}
+}
+
+// compute the concordance with contexts of 15 words on each side of the keyword
+//query = new Query(Query.fixQuery(query))
+def viewprops = [word]
+viewprops.addAll(annots)
+Concordance concordance = new Concordance(corpus)
+concordance.setParameters(query, [word], [word], [word], viewprops, viewprops, viewprops, referencePattern, referencePattern, leftcontextsize, rightcontextsize)
+concordance.compute()
+//println "Conc done "+(System.currentTimeMillis()-start)
+
+def writer = tsvFile.newWriter("UTF-8");
+
+//println "Writing lines..."
+start = System.currentTimeMillis()
+String annotHeader = ""
+for (def annot : annots) annotHeader += "\t$annot"
+writer.write("N"+"\t"+"Références"+"\t"+"ContexteGauche"+"\t"+"Pivot"+annotHeader+"\t"+"ContexteDroit"+"\t"+"id"+"\t"+"text_id\n")
+
+// define which occurrence properties will be displayed
+concordance.setViewProperties([word])
+int NLines = concordance.getNLines();
+int chunk = 1000;
+for (int i = 0 ; i < concordance.getNLines() ; i += chunk) {
+	List<Line> lines
+	if (i+chunk > NLines)
+		lines = concordance.getLines(i, concordance.getNLines()-1)
+	else
+		lines = concordance.getLines(i, i+chunk-1) // e.g. from 0 to 999
+
+	int n = 1
+	for (Line l : lines) {
+		String ntext = l.getViewRef().getValue(text_id)
+		String lcontext = l.leftContextToString()
+		String pivot = l.keywordToString()
+		String rcontext = l.rightContextToString()
+		String ids = l.getViewRef().getValue(id)
+		String refValue = "";
+		for (def refp : refProperties) refValue += " "+l.getViewRef().getValue(refp)
+
+		String poss = "";
+		for (def annot : annots) {
+			poss += "\t"+l.getViewRef().getValue(annot)
+		}
+
+		//println l.getKeywordsViewProperties().get(pos)
+		writer.write(""+(l.getKeywordPosition())+"\t"+refValue+"\t"+lcontext+"\t"+pivot+poss+"\t"+rcontext+"\t"+ids+"\t"+ntext+"\n")
+	}
+	writer.flush()
+}
+println "Saved in "+tsvFile.getAbsolutePath()
+writer.close()
\ No newline at end of file
Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/ExportWordPropertiesToTableMacro.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/ExportWordPropertiesToTableMacro.groovy	(revision 3422)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/ExportWordPropertiesToTableMacro.groovy	(revision 3423)
@@ -50,21 +50,21 @@
 
 
 @Field @Option(name="properties", usage="columns to inject separated by commas", widget="String", required=true, def="p1, p2, ... , pn")
-		def properties = "pos"
+		def properties
 
 @Field @Option(name="query", usage="The query to select words to annotate", widget="Query", required=true, def="[]")
 		def query
 
 @Field @Option(name="leftcontextsize", usage="The context sizes", widget="Integer", required=true, def="10")
-		def leftcontextsize = 10
+		def leftcontextsize
 
 @Field @Option(name="rightcontextsize", usage="The context sizes", widget="Integer", required=true, def="10")
-		def rightcontextsize = 10
+		def rightcontextsize
 
 @Field @Option(name="references", usage="references to show", widget="String", required=true, def="text_id")
-		def references = "text_id, p_id, s_id"
+		def references
 
-@Field @Option(name="tsvFile", usage="The result TSV file", widget="File", required=true, def="export.tsv")
+@Field @Option(name="tsvFile", usage="The result TSV file", widget="FileSave", required=true, def="export.tsv")
 		def tsvFile
 
 if (!ParametersDialog.open(this)) return;
@@ -81,6 +81,7 @@
 println "- corpus: $corpus"
 println "- query: $query"
 println "- annotation properties: $properties"
+println "- references: $properties"
 println "- TSV file: $tsvFile"
 
 tsvFile = tsvFile.getAbsoluteFile()
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/WordPropertiestoTable.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/WordPropertiestoTable.java	(revision 3422)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/WordPropertiestoTable.java	(revision 3423)
@@ -1,7 +1,9 @@
 package org.txm.rcp.commands.function;
 
 import java.io.File;
+import java.util.HashMap;
 
+import org.apache.commons.lang.StringUtils;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
@@ -9,17 +11,32 @@
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.Toolbox;
+import org.txm.objects.CorpusBuild;
 import org.txm.rcp.handlers.scripts.ExecuteGroovyMacro;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
+import org.txm.searchengine.cqp.corpus.query.CQLQuery;
+import org.txm.utils.logger.Log;
 
 public class WordPropertiestoTable extends AbstractHandler{
-
+	
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		IWorkbenchPart part = HandlerUtil.getActivePart(event);
 		IStructuredSelection selection = HandlerUtil.getCurrentStructuredSelection(event);
 		
+		Object first = selection.getFirstElement();
+		if (!(first instanceof MainCorpus)) {
+			Log.warning("Selection must be a corpus. Aborting");
+			return null;
+		}
+		
+		MainCorpus corpus = (MainCorpus)first;
+
 		File script = new File(Toolbox.getTxmHomePath(), "/scripts/groovy/user/org/txm/macro/annotation/ExportWordPropertiesToTableMacro.groovy");
-		ExecuteGroovyMacro.execute(script.getAbsolutePath(), part, selection, "");
+		File parametersFile = new File(Toolbox.getTxmHomePath(), "/scripts/groovy/user/org/txm/macro/annotation/ExportWordPropertiesToTableMacro.properties");
+		
+		ExecuteGroovyMacro.execute(script.getAbsolutePath(), part, selection, "", null);
 		return null;
 	}
 }
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/WordPropertiesFromTable.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/WordPropertiesFromTable.java	(revision 3422)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/function/WordPropertiesFromTable.java	(revision 3423)
@@ -1,7 +1,9 @@
 package org.txm.rcp.commands.function;
 
 import java.io.File;
+import java.util.HashMap;
 
+import org.apache.commons.lang.StringUtils;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
@@ -10,6 +12,9 @@
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.Toolbox;
 import org.txm.rcp.handlers.scripts.ExecuteGroovyMacro;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
+import org.txm.utils.logger.Log;
 
 public class WordPropertiesFromTable extends AbstractHandler{
 
@@ -18,8 +23,18 @@
 		IWorkbenchPart part = HandlerUtil.getActivePart(event);
 		IStructuredSelection selection = HandlerUtil.getCurrentStructuredSelection(event);
 		
-		File script = new File(Toolbox.getTxmHomePath(), "/scripts/groovy/user/org/txm/macro/annotation/ImportWordPropertiesFromTableMacro.groovy");
-		ExecuteGroovyMacro.execute(script.getAbsolutePath(), part, selection, "");
+		Object first = selection.getFirstElement();
+		if (!(first instanceof MainCorpus)) {
+			Log.warning("Selection must be a corpus. Aborting");
+			return null;
+		}
+		
+		MainCorpus corpus = (MainCorpus)first;
+		
+		File script = new File(Toolbox.getTxmHomePath(),         "/scripts/groovy/user/org/txm/macro/annotation/ImportWordPropertiesFromTableMacro.groovy");
+		File parametersFile = new File(Toolbox.getTxmHomePath(), "/scripts/groovy/user/org/txm/macro/annotation/ImportWordPropertiesFromTableMacro.properties");
+
+		ExecuteGroovyMacro.execute(script.getAbsolutePath(), part, selection, "", null);
 		return null;
 	}
 	
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/views/fileexplorer/MacroExplorer.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/views/fileexplorer/MacroExplorer.java	(revision 3422)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/views/fileexplorer/MacroExplorer.java	(revision 3423)
@@ -271,7 +271,7 @@
 					IWorkbenchPart page = acWindow.getActivePage().getActivePart();
 					
 					if (selectedItem.getName().toLowerCase().endsWith(".groovy")) {
-						ExecuteGroovyMacro.execute(selectedItem.getAbsolutePath(), page, selection, "");
+						ExecuteGroovyMacro.execute(selectedItem.getAbsolutePath(), page, selection, "", null);
 					}
 					else {
 						String ext = FileUtils.getExtension(selectedItem);
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteGroovyMacro.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteGroovyMacro.java	(revision 3422)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteGroovyMacro.java	(revision 3423)
@@ -28,6 +28,7 @@
 package org.txm.rcp.handlers.scripts;
 
 import java.io.File;
+import java.util.HashMap;
 import java.util.Iterator;
 
 import org.eclipse.core.commands.AbstractHandler;
@@ -112,16 +113,16 @@
 			LastOpened.set(ID, new File(result));
 		}
 
-		return execute(result, page, selection, stringArgs);
+		return execute(result, page, selection, stringArgs, null);
 	}
 	
-	public static IStatus execute(String scriptpath, IWorkbenchPart page, ISelection selection, String stringArgs) {
+	public static IStatus execute(String scriptpath, IWorkbenchPart page, ISelection selection, String stringArgs, HashMap<String, Object> parameters) {
 		//IPreferencesService service = Platform.getPreferencesService();
 		String scriptRootDir = Toolbox.getTxmHomePath() + "/scripts"; //$NON-NLS-1$
 		File currentRootDir = new File(scriptRootDir, "groovy/user"); //$NON-NLS-1$
 		
 		if (scriptpath.endsWith(".groovy")) {
-			return ExecuteGroovyScript.executeScript(currentRootDir, scriptpath, page, selection, false, stringArgs);
+			return ExecuteGroovyScript.executeScript(currentRootDir, scriptpath, page, selection, false, stringArgs, parameters);
 		} else {
 			return ExecuteScript.executeScript(scriptpath, page, selection, stringArgs);
 		}
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteGroovyScript.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteGroovyScript.java	(revision 3422)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteGroovyScript.java	(revision 3423)
@@ -28,6 +28,7 @@
 package org.txm.rcp.handlers.scripts;
 
 import java.io.File;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 
@@ -163,7 +164,7 @@
 		String scriptRootDir = Toolbox.getTxmHomePath() + "/scripts"; //$NON-NLS-1$
 		File currentRootDir = new File(scriptRootDir, "groovy/user"); //$NON-NLS-1$
 
-		return executeScript(currentRootDir, scriptpath, page, selection, modal, stringArgs);
+		return executeScript(currentRootDir, scriptpath, page, selection, modal, stringArgs, null);
 	}
 
 	/**
@@ -195,7 +196,7 @@
 	 * @param page current active page, might be null
 	 * @param sel current selection, might be null
 	 */
-	public static IStatus executeScript(final File currentRootDir, String scriptpath, final  IWorkbenchPart page, final ISelection sel, final boolean modal, final String stringArgs) {
+	public static IStatus executeScript(final File currentRootDir, String scriptpath, final  IWorkbenchPart page, final ISelection sel, final boolean modal, final String stringArgs, HashMap<String, Object> parameters) {
 		// check script
 		final File scriptfile = new File(scriptpath);
 		if (!scriptfile.exists()) {
@@ -259,6 +260,7 @@
 					binding.setProperty("monitor", this); //$NON-NLS-1$
 					binding.setProperty("MONITOR", this); //$NON-NLS-1$
 					binding.setProperty("stringArgs", stringArgs); //$NON-NLS-1$
+					if (parameters != null) binding.setProperty("args", parameters); //$NON-NLS-1$
 					binding.setProperty("gse", gse);
 					Timer timer = new Timer();
 					binding.setProperty("timer", timer); //$NON-NLS-1$
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteLastGroovyScript.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteLastGroovyScript.java	(revision 3422)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteLastGroovyScript.java	(revision 3423)
@@ -90,6 +90,6 @@
 			return;
 		}
 		
-		ExecuteGroovyScript.executeScript(currentRootDir, lastScript.getAbsolutePath(), page, selection, false, "");
+		ExecuteGroovyScript.executeScript(currentRootDir, lastScript.getAbsolutePath(), page, selection, false, "", null);
 	}
 }
\ No newline at end of file
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/menu/MacrosMenuContribution.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/menu/MacrosMenuContribution.java	(revision 3422)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/menu/MacrosMenuContribution.java	(revision 3423)
@@ -145,7 +145,7 @@
 		public void widgetSelected(SelectionEvent e) {
 			IWorkbenchWindow acWindow = TXMWindows.getActiveWindow();
 			IWorkbenchPart page = acWindow.getActivePage().getActivePart();
-			ExecuteGroovyMacro.execute(macro.getAbsolutePath(), page, CorporaView.getInstance().getTreeViewer().getSelection(), "");
+			ExecuteGroovyMacro.execute(macro.getAbsolutePath(), page, CorporaView.getInstance().getTreeViewer().getSelection(), "", null);
 		}
 	}
 	
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/p2/plugins/TXMUpdateHandler.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/p2/plugins/TXMUpdateHandler.java	(revision 3422)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/p2/plugins/TXMUpdateHandler.java	(revision 3423)
@@ -38,6 +38,9 @@
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IOConsole;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.osgi.framework.Version;
 import org.txm.core.preferences.TBXPreferences;
@@ -92,6 +95,11 @@
 		try {
 			Log.info("Looking for TXM updates...");
 			
+			// flush console ?
+			org.eclipse.ui.console.IOConsole console = (IOConsole) (ConsolePlugin.getDefault().getConsoleManager().getConsoles())[0];
+			console.activate();
+			ConsolePlugin.getDefault().getConsoleManager().refresh(console);
+			
 			ProvisioningUI pui = ProvisioningUI.getDefaultUI();
 			
 			String profileId = pui.getProfileId();
