So it's the messy solution I'm afraid XD
Ok, I've rearranged the JSFL manual's algorithm for contours' navigation in order to store the vertices of a path neatly in an array, so the first and last element of the array would be the end points:
//just take first contour for testing. Can loop through "contours" array for the others eventually
var contour = fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0].contours[0];
var he = contour.getHalfEdge();
var iStart = he.id;
var id = 0;
var points = [];
while (id != iStart) {
points.unshift(he.getVertex());
if(he.getPrev().getEdge().id==he.getOppositeHalfEdge().getEdge().id) {
points.unshift(he.getPrev().getVertex());
break;
}
he = he.getPrev();
id = he.id;
}
he = contour.getHalfEdge();
iStart = he.id;
id = 0;
while (id != iStart) {
points.push(he.getVertex());
if(he.getNext().getEdge().id==he.getOppositeHalfEdge().getEdge().id) {
break;
}
he = he.getNext();
id = he.id;
}
var startPoint = points[0];
var endPoint = points[points.length-1];
Note that this won't work always properly with paths having lines crossing each other (like an X-shaped path in merge drawing mode or a curled line in any drawing mode) since Animate has an odd method of creating crossing lines (not neat as Illustrator), but at least the start and end point should be correct in most of those cases. It will need some more tweaking for better storing middle points, but I hope it's enough for your current situation 