Index: trunk/FACT++/scripts/takeRun.js
===================================================================
--- trunk/FACT++/scripts/takeRun.js	(revision 18127)
+++ trunk/FACT++/scripts/takeRun.js	(revision 18128)
@@ -133,6 +133,8 @@
         time = -1;
 
+    var custom = typeof(type)=="function";
+
     var nextrun = sub_startrun.get().obj['next'];
-    dim.log("Take run %3d".$(nextrun)+": N="+count+" T="+time+"s ["+type+"]");
+    dim.log("Take run %3d".$(nextrun)+": N="+count+" T="+time+"s ["+(custom?"custom":type)+"]");
 
     // FIXME: Replace by callback?
@@ -206,9 +208,13 @@
     {
         if (start)
-            dim.send("MCP/START", time, count, type);
+        {
+            dim.send("MCP/START", time, count, custom?"custom":type);
+            if (custom)
+                type();
+        }
 
         try
         {
-            dim.wait("MCP", "TakingData", 15000);
+            dim.wait("MCP", custom?"TriggerOn":"TakingData", 15000);
             break;
         }
