(UXP) Get filepath of a VideoClipTrackItem?

Hello everyone! :slight_smile:

Do you know if there is another possibility to get the file path of a VideoClipTrackItem object?

I don’t see an object method that seems to do that. :sweat_smile:

Thanks a lot!

Found it!

const projectItem = await videoClipTrackItem.getProjectItem();
const clipProjectItem = await ppro.ClipProjectItem.cast(projectItem);
const mediaFilepath = await clipProjectItem.getMediaFilePath())

Hey Max —

Thanks for posting your solution on how to get the file path from a VideoClipTrackItem. Super helpful!

I’m currently trying to do something similar, but specifically with an AudioClipTrackItem from the timeline. I saw your code:

const projectItem = await videoClipTrackItem.getProjectItem();
const clipProjectItem = await ppro.ClipProjectItem.cast(projectItem);
const mediaFilepath = await clipProjectItem.getMediaFilePath();

…but I’m stuck trying to figure out how you actually got that videoClipTrackItem object in the first place. I’ve been digging through ppro.TrackItemSelection, Sequence, Editor, and Application, but haven’t found a reliable way to access timeline clip objects.

If you’re open to sharing how you accessed the track item, I’d really appreciate it.

Thanks a ton in advance!

– Jason

Hi Jason!

I’m getting VideoClipTrackItem objects from the Sequence object:

const videoTrackCount = await sequence.getVideoTrackCount();
for (let trackIndex = 0; trackIndex < videoTrackCount; trackIndex++) {
    const videoTrack = await sequence.getVideoTrack(trackIndex);
    const videoClipTrackItems = await videoTrack.getTrackItems(1, false);
}

It should working if you start with getAudioTrackCount().

Hope it helps! :slight_smile:

I got it to work!

Thank you.

1 Like