Copy link to clipboard
Copied
Dear Adobe Premiere Pro Support Team,
I am currently developing a Premiere Pro extension using the UXP scripting API, and I am encountering difficulties when trying to access captions from a sequence’s CaptionTrack.
Specifically, I can successfully retrieve the CaptionTrack object using sequence.getCaptionTrack(), and I can confirm its presence and properties such as id and name. However, when attempting to get caption items using methods like getItems() or getTrackItems(), I consistently receive errors such as:
“Not Enough Parameters”
“captionTrack.getItems is not a function”
From inspecting the CaptionTrack object, I found that it has a method getTrackItems(), but it appears to require parameters which are not clearly documented.
Below is a simplified snippet of the code I tried:
const captionTrack = await sequence.getCaptionTrack(); if (!captionTrack) { alert("No caption track found."); } else { alert(`CaptionTrack found. ID: ${captionTrack.id}, Name: ${captionTrack.name}`); // Attempting to get caption items try { const items = await captionTrack.getTrackItems(); alert(`Number of captions: ${items.length}`); } catch (error) { alert(`Error: ${error.message}`); } }
I would greatly appreciate guidance on the correct usage of the CaptionTrack API to access individual caption items (text, timing, etc.) within a CaptionTrack in the UXP environment. If there is sample code or updated documentation addressing this, that would be very helpful.
Thank you very much for your support and assistance.
Best regards,
Muhammadhussein Ammari
Hi xmha97,
Unfortunately, Caption API is still under construction, and there is no available API to access and modify caption properties yet. To access trackItems inside of caption track and use available trackItem API, like the documentation website suggested, you will need input parameters: trackItemType and includeEmptyTrackItem for getTrackItems API. A example usage would be like
const trackItems = await captionTrack.getTrackItems(
ppro.Constants.TrackItemType.CLIP,
...
Copy link to clipboard
Copied
Hi,
Thanks for your question. I changed the tag of the post to SDK. That way, the right developers will come by to help you. Good luck!
Thanks,
Kevin
Copy link to clipboard
Copied
Hi xmha97,
Unfortunately, Caption API is still under construction, and there is no available API to access and modify caption properties yet. To access trackItems inside of caption track and use available trackItem API, like the documentation website suggested, you will need input parameters: trackItemType and includeEmptyTrackItem for getTrackItems API. A example usage would be like
const trackItems = await captionTrack.getTrackItems(
ppro.Constants.TrackItemType.CLIP,
false // includeEmptyTrackItems
);
Caption API is absolutely something planned for future - Apologies for inconvinence, and thanks for trying out UXP!
Copy link to clipboard
Copied
Cathy is 100% correct, and...PPro UXP partners are invited to use the PPro UXP CC Developer Forum, to discuss pre-release APIs.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now