Hello!I’m trying to figure out how to get items in a specific bin.Bigger idea is to add clips to the track from a specific folder using clip filename filter.However getItems seems to work fine on the root level, but doesn’t return items within a specific bin. Or I got it wrong how to access it.Here is a sample code:
const rootItem = await project.getRootItem();
const newItems = await rootItem.getItems();
const srcBin = newItems.find((item) => item.name == “SRC”);
(0, utils_1.log)(got bin object: ${srcBin.name})
let mediaitem;
for(let srcBinItem of srcBin.getItems()){
const clipBniItem = ppro.ClipProjectItem.cast(binItem);
if (clipBniItem && (await clipBniItem.getContentType()) === ppro.Constants.ContentType.MEDIA) {
(0, utils_1.log)(media item name: ${clipBniItem.name});
}
}
In the output window I see “got bin object: SRC” so folder is there and then
I’m getting error srcBin.getItems is not a function or its return value is not iterable.
Could someone give me a hint please how to get items from a bin?