The following code is untested, but something like it should work for you. Please let me know if there are any changes you need to make.
/* Exports mesh data 'm' to file 'f' */
def exportData m f = (
format "%,%\n" m.numverts m.numfaces to:f
for i = 1 to m.numverts do
format "%," (getVert m i) to:f
format "\n" to:f
for i = 1 to m.numfaces do
format "%," (getFace m i) to:f
)
/* Exports mesh data from a node 'n' at time 't' to file 'f' */
def exportNodeMeshAtTime t n f =
(
at time t
m = snapshotAsMesh n
exportMesh m f
)
/* Create a text file for receiving the data */
out_file = createfile ((GetDir #export)+"/testmesh.dat")
/* Enumerate all times in the animation range, exporting
the mesh data from the selected node at time t. */
for t = animationRange.start to animationRange.end do (
exportNodeMeshAtTime t selection[1] out_file
)
/* Close the text file */
close out_file