I can get the [object TrackItemSelection] but how do I find what’s in the object?
I’m looking for the name, in/out timecode and to create a thumbnail of the first and last frame of the selected clip.
I’ve tried .name but get nothing back.
I can get the [object TrackItemSelection] but how do I find what’s in the object?
I’m looking for the name, in/out timecode and to create a thumbnail of the first and last frame of the selected clip.
I’ve tried .name but get nothing back.
I realize that was a little vague!
Here is what shows up in the console:
Active project: xxx.prproj
Active sequence: xxx
41 Active clip: [object TrackItemSelection]
(ends there)
But I don’t know how to access what’s in the object?
async function poplulateApplicationInfo() {
const project = await ppro.Project.getActiveProject();
if (!project) {
log("There is no active project found", "red");
console.log("There is no active project found", "red");
} else {
log(`Active project: ${project.name}`);
console.log(`Active project: ${project.name}`);
const sequence = await project.getActiveSequence();
if (!sequence) {
log("There is no active sequence found", "red");
} else {
log(`Active sequence: ${sequence.name}`);
console.log(`Active sequence: ${sequence.name}`);
const selectedClip = await sequence.getSelection();
console.log(`Active clip: ${selectedClip}`);
//console.log(`Active clip name: ${selectedClip.name}`);
let projectItem = await selectedClip.getProjectItem();
let name = await projectItem.name;
console.log(`Active clip name 2: ${name}`);
}
Hi FutureX,
Thanks for joining the discussion.
So, two-part answer; first, have a look at getTrackItems
which will return an array of VideoClipTrackItem/AudioClipTrackItem inside of a TrackItemSelection Object.
Something like let trackItems = await trackItemSelection.getTrackItems()
would do the work.
Until we get trackItem.name ready, use getProjectItem()
from the selected trackItem should work after you use getTrackItems()
and get correct element out of the array - clipProjectItem.name
is available now. You can also can use getInPoint()
and getOutPoint()
API from trackItem for getting those properties.
And for part two, I’m told that trackItem.name - will be coming soon.
-Dan
Hi Dan,
Thank you for the help! I got it working!
Next question, I need to grab the sequence timecode. We’re logging stock clips to a spreadsheet. So far haven’t been successful
Thanks!
FutureX