Skip to main content
Participant
Jan 24, 2025 1:37 AM UTC
Answered

Help Needed: ExtendScript to Cut Clips at Specific Timestamps

Hi everyone,

I'm trying to write an ExtendScript to automate cutting clips in Premiere Pro at specific timestamps. My goal is to:

  1. Use a script to cut the video clips on Video Track 0 at multiple timestamps (e.g., 00:00:05:00 to 00:00:06:10 , 00:00:10:00 to 00:00:12:10, etc.).
  2. Ensure it adheres to ES2 standards (no modern JS features).
  3. Follow the official Premiere Pro API guidelines without using AI tools or unofficial APIs.

Problem:

I’ve tried a few scripts, but none seem to work correctly. Here are the issues I’m facing:

  • The script doesn’t cut the clips at the specified timestamps.
  • It seems like the split() method isn’t behaving as expected.
  • I’m not sure if I’m calculating the timecode-to-ticks conversion properly.

    Can anyone please create and share the code for my use case here? It will be beneficial. Thanks in Advance.
Bruce Bullis
Bruce BullisCorrect answer
Legend
Jan 24, 2025 6:30 PM UTC

> It seems like the split() method isn’t behaving as expected.

 

There is no split method.

You could truncate (change the end point) of the earlier trackItem, and insert a new trackItem (based on the same projectItem) at the end of the earlier trackItem. 

> I’m not sure if I’m calculating the timecode-to-ticks conversion properly.

A Time() object will perform the conversion for you; see PProPanel. There are 254016000000 ticks/second.

4 replies

Bruce Bullis
Bruce BullisCorrect answer
Legend
Jan 24, 2025 6:30 PM UTC

> It seems like the split() method isn’t behaving as expected.

 

There is no split method.

You could truncate (change the end point) of the earlier trackItem, and insert a new trackItem (based on the same projectItem) at the end of the earlier trackItem. 

> I’m not sure if I’m calculating the timecode-to-ticks conversion properly.

A Time() object will perform the conversion for you; see PProPanel. There are 254016000000 ticks/second.

Translate
Participant
Jan 27, 2025 1:16 AM UTC

Hi @Bruce Bullis ,

Could you provide me with a sample or example code? It would be very helpful. I have tried all possibilities, but nothing has worked for me.

Translate
Bruce Bullis
Legend
Jan 27, 2025 4:30 AM UTC

The PProPanel sample (to which I linked above) is the best source of example code.

Translate
Kevin J. Monahan Jr.
Legend
Jan 24, 2025 1:52 AM UTC

HI @ALSHEFAN_A2162,

Thanks for the note and welcome to the forum. I'm Kevin from Adobe Support, a moderator here. I appreciate the information you gave. Hopefully, an Adobe Expert or developer will respond shortly. Take care.

 

Thanks,
Kevin

 

Translate
Kevin Monahan - Sr. Community and Engagement Strategist – Adobe Pro Video and Audio