Okay, try this. It might need some tweaking for what you're doing.
#target photoshop
var srcFolder = new Folder('~/desktop/MOOP_VYNl/');
var saveFolder = new Folder'~/desktop/Batch_out/')
if(!saveFolder.exists){saveFolder.create()};
var searchMask = '*.jpg';
var fileList = srcFolder.getFiles(searchMask);
for(var i =0;i <fileList.length;i++){
var doc = open(fileList[i]);
var docName = doc.name.split('.')[0];
playAction ();
saveLog (docName);
deleteLog ();
doc.close(SaveOptions.DONOTSAVECHANGES)
}
function playAction(){
var idPly = charIDToTypeID( "Ply " );
var desc2 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref1 = new ActionReference();
var idActn = charIDToTypeID( "Actn" );
ref1.putName( idActn, "MY_MOOPY" );
var idASet = charIDToTypeID( "ASet" );
ref1.putName( idASet, "MOOPV5" );
desc2.putReference( idnull, ref1 );
executeAction( idPly, desc2, DialogModes.NO );
}
function saveLog(fName){
var idexportMeasurements = stringIDToTypeID( "exportMeasurements" );
var desc11 = new ActionDescriptor();
var idFile = charIDToTypeID( "File" );
desc11.putPath( idFile, new File( saveFolder +'/'+fName + '.txt') );
executeAction( idexportMeasurements, desc11, DialogModes.NO );
}
function deleteLog(){
var iddeleteMeasurements = stringIDToTypeID( "deleteMeasurements" );
var desc28 = new ActionDescriptor();
executeAction( iddeleteMeasurements, desc28, DialogModes.NO );
}
function recordLog(){
var idrecordMeasurements = stringIDToTypeID( "recordMeasurements" );
var desc25 = new ActionDescriptor();
var idSrce = charIDToTypeID( "Srce" );
var idmeasurementSource = stringIDToTypeID( "measurementSource" );
var idfsel = charIDToTypeID( "fsel" );
desc25.putEnumerated( idSrce, idmeasurementSource, idfsel );
var iddataPoints = stringIDToTypeID( "dataPoints" );
var list2 = new ActionList();
var idmeasurementDataPoint = stringIDToTypeID( "measurementDataPoint" );
var idArea = stringIDToTypeID( "Area" );
list2.putEnumerated( idmeasurementDataPoint, idArea );
desc25.putList( iddataPoints, list2 );
executeAction( idrecordMeasurements, desc25, DialogModes.NO );
}