UXP API to create AudioTrack to a Sequence/timeline?

Hello,

I’m working on a plugin for premier and am able to do many thing I wanted to.
I can get the number of track and loop thru all track (both Audio and video), can iterate recursively over folders, create new folders, add import files to folder, etc…
However I went thru the API ( including Sequence & SequenceEditor, … ) but did no see a way to add a new AudioTrack to an existing sequence.
(this is about adding the track itself, not adding a new item to an existing track)

Is this planned for later ?
Or did I miss the API that would achieve this ?

Thx !

Never mind, I found the answer by playing a bit more with it.
Apparently a new track will automatically be created when targeting a track above the actual count.

// ...
let audiotrackCount = await currSequence.getAudioTrackCount()
// ...
// ...
let action = seqEditor.createInsertProjectItemAction(projItem, insertAt, videotrackCount, audiotrackCount, onlyShiftInputTrack)
compoundAction.addAction(action)

4 Likes

Glad you got it to work! [We’ll update the docs to reflect your happy discovery.]