Skip to main content
Inspiring
July 1, 2021
Answered

Is there a way to get selected track items all at once in Premiere Pro API?

  • July 1, 2021
  • 1 reply
  • 1409 views

Hello,
I'm having trouble developing a script in Premiere Pro. I'm asking because I couldn't find a solution by searching.

 

Is there a way to get all selected track items in a Premiere Pro sequence at once?

For example, is it possible to get selected track items at a similar speed to selectedLayers in Adobe After Effects?

 

There are workarounds like trackItem's isSelected() method, but it's too slow to use in real-time as accessing one selected clip requires evaluating true/false for the entire track's track items.

From what I've searched, there doesn't seem to be a way around this in the current script.

 

If it can't be solved at the script level, is there a way to solve it in the Premiere Pro Plugin SDK (C++)?

 

Requires the same properties or methods as selectedLayers in Adobe After Effects. Is there a quick way to get the index of the track and the index of the selected track item?

Developers, I would appreciate it if you could tell me that this is impossible if it is in an impossible form.

 

If you want to solve this problem, but it is not possible, you want to limit functionality or stop developing the tool.

 

Please help me~

This topic has been closed for replies.
Correct answer Bruce Bullis

The isSelected() method isn't a work-around; it's provided for exactly this purpose. 

I'm not sure how one would evaluate all trackItems, without evaluating each trackItem...?

There is no C++ API around track item selection.

 

 

1 reply

Bruce Bullis
Community Manager
Bruce BullisCommunity ManagerCorrect answer
Community Manager
July 1, 2021

The isSelected() method isn't a work-around; it's provided for exactly this purpose. 

I'm not sure how one would evaluate all trackItems, without evaluating each trackItem...?

There is no C++ API around track item selection.

 

 

Known Participant
May 4, 2023

I have the same question-- iterating across ALL track items and checking isSelected() is a very clunky workflow.

Is this the best practice for accessing the currently selected track item? 

 

For example, I have a MOGRT selected on my timeline. It is the only track item selected in the entire timeline. What is the fastest way to change this MOGRT track item's properties?

Bruce Bullis
Community Manager
Community Manager
May 4, 2023

Is this the best practice for accessing the currently selected track item?

Yes.

You can also register a function to be called whenever the sequence selection changes; see PProPanel's onActiveSequenceSelectionChanged().


>...I have a MOGRT selected on my timeline. It is the only track item selected in the entire timeline. What is the fastest way to change this MOGRT track item's properties?

 

If you already know which trackItem is your .mogrt, then current selection doesn't matter; you can just operate on the .mogrt's trackItem's properties.