Set playhead at the end of just added subclip

Explorer ,
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

106

Likes

Translate

Translate

Report

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

1 Correct Answer

Adobe Employee , Nov 16, 2020
Bruce Bullis Adobe Employee , Nov 16, 2020
Yes! Since insertClip() returns the newly-added clip object, you can set the CTI to the end of the inserted clip.

Likes

Translate

Translate
Jump to answer Jump to answer
Adobe Employee ,
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.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
dpt12 AUTHOR
Explorer ,
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?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Employee ,
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.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
dpt12 AUTHOR
Explorer ,
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)?

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Employee ,
Nov 17, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
dpt12 AUTHOR
Explorer ,
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.

 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Employee ,
Nov 17, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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