I'm using Premiere scripting. I'm creating and adding a new clip to a track, at the location of the playhead:
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?
Yes! Since insertClip() returns the newly-added clip object, you can set the CTI to the end of the inserted clip.
Thanks for the quick response. I get true from that expression, and not the newly added clip:
what do I miss here?
My mistake; you can iterate across the clips in the video track, find the last-most one, and use its end time.
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)?
The last one in the trackItems array should be the latest (in time), yes?
yes, but I can place the new clip anywhere, not necessarily at the end. for example:
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.
In that case, you'll need to understand the contents of .trackItems, before and after the insertion, then compare to find the new one.