Copy link to clipboard
Copied
I am working in a Premiere pro panel,to add some things with the player postion;But i can not figure out how to judge the place which has no clips to insert,i write about the tracks loop and clips loop,it must be wrong,please help me to find the keys,i think the way i thought is corrects,how to solve this:
var sequence = app.project.activeSequence;
var time = sequence.getPlayerPosition();
var headTicks = time.ticks;
var mogrtFile ="F:/packs/1.mogrt";
for(i = 0 ; i < sequence.videoTracks.length ; i++){
var noTracks = sequence.videoTracks[i].name;
alert(sequence.videoTracks[i].name);
for(j = 0 ; j < sequence.videoTracks[i].clips.length; j++){
var clipsinTicks = sequence.videoTracks[i].clips[j].start.ticks;
var clipsoutTicks = sequence.videoTracks[i].clips[j].end.ticks;
alert("clips"+j);
if( parseFloat(headTicks) < (parseFloat(clipsoutTicks)) ){
alert("insert");
var projectItem = sequence.importMGT(mogrtFile,time,i,i);
var flag = 1;
if(flag == 1){
break;
}
}
}
}
Ticks are strings; I don't think evaluating them as Floats will help. 🙂 Not sure what 'flags' is doing...?
Copy link to clipboard
Copied
Ticks are strings; I don't think evaluating them as Floats will help. 🙂 Not sure what 'flags' is doing...?