This should work. Select the layer you want to use the script on and then run it
var myMarker = new MarkerValue("Insert Comment Here");//leave blank for empty
var frameDuration = app.project.activeItem.frameDuration;
var myFile = File.openDialog("Please select your marker file");
var framesArray = extractDataFromFile(myFile);
var timeArray = (framesArray!=null) ? framesToTime(framesArray) : [];//framesArray must be an array with the numbers from your file
var myLayer = app.project.activeItem.selectedLayers[0];
for (var i=0; i < timeArray.length; i++){
myLayer.property("Marker").setValueAtTime(timeArray[i], myMarker);
}
function framesToTime(framesArray){
var timeArray =[];
for (var i=0; i < framesArray.length; i++){
timeArray.push(framesArray[i]*frameDuration);
}
return timeArray;
}
function extractDataFromFile(myFile){
if (!myFile) return;
markerData = [];
if (myFile.open("r")){
while(!myFile.eof){
var frameNumber = parseFloat(myFile.readln());
markerData.push(frameNumber);
}
return markerData;
}else alert("Could not open your file");
}
Andrei
My Envato portfolio.