Retrieving exposure time from lif file

Hi!
I am trying to retrieve the exposure time from a .lif file, using the ij-macro language. However the exposure time is NaN , when I use the macro as shown below:

run("Bio-Formats Macro Extensions");
id = File.openDialog("Choose a file"); 
Ext.setId(id);
Ext.getSeriesCount(seriesCount);
Ext.getCurrentFile(file);
print("%%% "+file+" %%%");
for (s=0; s<seriesCount; s++) {
  Ext.setSeries(s);
  Ext.getPlaneTimingExposureTime(ExposureTime,0);
  print("     t_exp = "+ ExposureTime);
  }
Ext.close();

Note: the exposure time can be accessed via the GUI (Plugin>Bioformats importer >show metadata), but unfortunately I do not know, how to retrieve the data via a script .

I would be very glad for any help !!

If you are seeing NaN returned it would suggest that the Exposure Time isnt populated on the Plane. You should see it in the OME-XML when you use the Importer as below:

<Plane DeltaT="2.309000015258789" DeltaTUnit="s" ExposureTime="200.0" ExposureTimeUnit="ms" PositionX="8007.400000000001" PositionXUnit="µm" PositionY="-3633.6000000000004" PositionYUnit="µm" PositionZ="25.675" PositionZUnit="µm" TheC="0" TheT="0" TheZ="0"/>

If you it isn’t present there but you can find it in the Show Info window then it can be accessed using the key name associated with it in Show Info:

Ext.getMetadataValue("Key Name", MetaValue);
print(" t_exp = "+ MetaValue);

Thank you very much!!

The following worked fine:

Ext.getSeriesMetadataValue("Key Name", MetaValue)