Hi there,
I´m trying to rename a VideoClipTrackItem via createSetNameAction but it seems like this just doesn´t work (yet?).
I tried to move the clip with createMoveAction which worked fine. But for some reason, createSetNameAction does nothing and I am also not getting the “setStartAction created” log → seems like it gets stuck when creating the renameAction already.
async function writeMetadataToClipname() {
const metadata = await getMetadata();
const string = JSON.stringify(metadata);
const project = await ppro.Project.getActiveProject();
const seq = await project.getActiveSequence();
const selection = await seq.getSelection();
const selectedItems = await selection.getTrackItems();
for (var i = 0; i < selectedItems.length; i++) {
const item = selectedItems[i];
if (Object.prototype.toString.call(item) !== '[object VideoClipTrackItem]') {
continue;
}
const getName = await item.getName();
const originalName = getName.split("//MD:")[0];
const newName = originalName + "//MD:" + string;
const renameAction = await item.createSetNameAction(newName);
console.log("setStartAction created");
await executeAction(project, renameAction);
}
}
Cheers!
Jannis