How to check if the selected item is a sequence?

Hello, how can we determine whether an item in a user’s selection is a sequence?

const proj = await ppro.Project.getActiveProject();
const projectSelection = await ppro.ProjectUtils.getSelection(proj);
const projectItems = await projectSelection.getItems();

for (const item of projectItems) {
    // How to check if each item is a sequence or not?
}

Thanks in advance! :blush:

You can use isSequence() API for ClipProjectItem

const proj = await ppro.Project.getActiveProject();
const projectSelection = await ppro.ProjectUtils.getSelection(proj);
const projectItems = await projectSelection.getItems();

for (const item of projectItems) {
    // How to check if each item is a sequence or not?
    let clipItem = await ppro.ClipProjectItem.cast(item);
    if (clipItem){
        let isSequence = await clipItem.isSequence(); 
    }
}

Thanks for trying out UXP!

3 Likes

It works perfectly!
Thank you very much! :raised_hands: