<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); ">
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">Dear all,</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">I am truing to get the acquisition date from ND2 file using the command <span class="Apple-style-span" style="font-family: Consolas; font-size: medium; ">Ext.getImageCreationDate(creationDate);
 I did a macro to batch process it. It is working great when all the file in the folder have name starting differently but if the name are too similar (only the last bit is different) the command is taking only the date from the first file and use it for all
 the files of the folder.</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span class="Apple-style-span" style="font-family: Consolas; font-size: medium; "><br>
</span></div>
<div><font class="Apple-style-span" face="Consolas">Here is the macro : </font></div>
<div><font class="Apple-style-span" face="Consolas">--------</font></div>
<div><font class="Apple-style-span" face="Consolas">
<div>requires("1.44c");</div>
<div><br>
</div>
<div>setBatchMode(true);</div>
<div><br>
</div>
<div>dir = getDirectory("Choose a Directory");</div>
<div>getTimeacquisition(dir);</div>
<div><br>
</div>
<div>setBatchMode(false);</div>
<div><br>
</div>
<div>function getTimeacquisition(dir){</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>list=getFileList(dir);</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>for (i=0; i<(list.length); i++){ </div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>print(list[i]);</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>if (endsWith(list[i], ".nd2")) {</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>title1 = "time";</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>title2 = "["+title1+"]";</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>f = title2;                       </div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>run("Text Window...", "name="+title2+" width=70 height=8");</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>run("Bio-Formats Macro Extensions");</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>id = dir+list[i];</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>Ext.setId(id); </div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>creationDate = "";</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>Ext.getImageCreationDate(creationDate);</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>print(f,id + ";AcquisitionDate; " + creationDate);</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>selectWindow("time");</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>Path=id+(".txt");</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>saveAs("Text", Path);</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>run ("Close");</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>}</div>
<div>}</div>
<div>-----</div>
<div>If the name in the folder are  : </div>
<div>!!!!!!!!!!!28jun2012-mcc640-AND t cells-TCR green-32ms2-exp2-1.nd2</div>
<div>!!!!!!!!!!28jun2012-mcc640-AND t cells-TCR green-32ms2-exp2-2.nd2</div>
<div>!!!!!!!!!28jun2012-mcc640-AND t cells-TCR green-32ms2-exp2-3.nd2</div>
<div><br>
</div>
<div>This is working </div>
<div><br>
</div>
<div>But if the name are </div>
</font><span class="Apple-style-span" style="font-family: Consolas; ">
<div>28jun2012-mcc640-AND t cells-TCR green-32ms2-exp2-1.nd2</div>
<div>28jun2012-mcc640-AND t cells-TCR green-32ms2-exp2-2.nd2</div>
<div>28jun2012-mcc640-AND t cells-TCR green-32ms2-exp2-3.nd2</div>
<div><br>
</div>
<div>Only the date from the file one is used and aply to the other</div>
<div>-----</div>
<div><br>
</div>
<div>I am using the LOCI oct 17th daily version with latest ImageJ or Fidji. It seems to happen only on mac computers.</div>
<div><br>
</div>
<div>Best,</div>
<div><br>
</div>
<div>David D</div>
</span><font class="Apple-style-span" face="Consolas">
<div><br>
</div>
<div><br>
</div>
</font></div>
</body>
</html>