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

Set playhead at the end of just added subclip

Explorer ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

Hey, 

I'm using Premiere scripting. I'm creating and adding a new clip to a track, at the location of the playhead:

 

    activeSeq.videoTracks[0].insertClip(subClip, activeSeq.getPlayerPosition())

 

 

I want to place the playhead right at the end of the clip that I just inserted.  Is there a straight forward way to do so? 

 
TOPICS
How to , SDK

Views

320

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 , Nov 16, 2020 Nov 16, 2020

Yes! Since insertClip() returns the newly-added clip object, you can set the CTI to the end of the inserted clip.

Votes

Translate

Translate
Adobe Employee ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

Yes! Since insertClip() returns the newly-added clip object, you can set the CTI to the end of the inserted clip.

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
Explorer ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

Thanks for the quick response. I get true from that expression, and not the newly added clip:

 

activeSeq.videoTracks[0].insertClip(subClip, activeSeq.getPlayerPosition())

 

what do I miss here?

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
Adobe Employee ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

My mistake; you can iterate across the clips in the video track, find the last-most one, and use its end time.

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
Explorer ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

can I find the last one added (not necessary the last one in the tracks array, cause I can add it anywhere on the sequence)?

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
Adobe Employee ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

The last one in the trackItems array should be the latest (in time), yes?

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
Explorer ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

yes, but I can place the new clip anywhere, not necessarily at the end. for example:

 

dpt12_0-1605639731837.png

 

I place a new clip at the playhead shown in the image above. It will position the new clip second in the trackItem list, so my clip wont be the last one.

 

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
Adobe Employee ,
Nov 17, 2020 Nov 17, 2020

Copy link to clipboard

Copied

LATEST

In that case, you'll need to understand the contents of .trackItems, before and after the insertion, then compare to find the new one.

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