• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CEP[ExtendScript]:How to insert a clip without overlap the clips which is already in the timeline?

Community Beginner ,
Feb 14, 2023 Feb 14, 2023

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;
    

        }
    
        }


       

    }

}

 

TOPICS
Editing , Error or problem , How to , SDK

Views

484

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Feb 14, 2023 Feb 14, 2023

Ticks are strings; I don't think evaluating them as Floats will help. 🙂 Not sure what 'flags' is doing...?


Votes

Translate

Translate
Adobe Employee ,
Feb 14, 2023 Feb 14, 2023

Copy link to clipboard

Copied

LATEST

Ticks are strings; I don't think evaluating them as Floats will help. 🙂 Not sure what 'flags' is doing...?


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines