Can’t seem to figure out if UXP is able to do a couple of things:
- move projectItems to a specific bin
- rename a projectItem (specifically, a sequence)
- duplicate a sequence and set a custom name
Can’t seem to figure out if UXP is able to do a couple of things:
For
You can use rootItem.createMoveItemAction(movedItem, binItem) which allows for moving the input movedItem into the input binItem.
You can rename the projectItem by using ppro.Metadata.createSetProjectMetadataAction(seqProjectItem, newMetadata, ["Column.Intrinsic.Name"]) API. You will need to get original metadata from projectItem to be renamed by projectItem.getProjectMetadata() and use uxp’s xmp API to set the name property with your custom name like
let projectItemMetadata = await ppro.Metadata.getProjectMetadata(
projectItem
);
let newMetadata = new XMPMeta(projectItemMetadata);
newMetadata.setProperty("http://ns.adobe.com/premierePrivateProjectMetaData/1.0/", "Column.Intrinsic.Name", newName);
// then use ppro.Metadata.createSetProjectMetadataAction(seqProjectItem, newMetadata, ["Column.Intrinsic.Name"]) to create action and execute the action
You can use sequence.createCloneAction() to duplicate a specific sequence. Then, you can use createSetProjectMetadataAction to find and set a custom name for the cloned sequence as suggested above.
Thank you for your answer, it was enlightening and very meaningful to me. I have another question. A video and a MOGRT have been placed on the active timeline sequence. How can I access the XMP metadata containing the “Author” name from the video and then insert it into a text parameter within the MOGRT using UXP? I have managed to do this with ExtendedScript, but I haven’t been able to with UXP.
( replying here in case you have not been looking at other threads )
You can’t, it seem like there is a bug ( or feature not quite ready) on MOGRT and text right now.
See MOGRT Parameters in UXP availabilty
Accessing text parameters within a MOGRT is quite fundamental. However, even though the components and parameters are exposed, it is unfortunate that text parameter values are currently inaccessible. Hopefully, they will provide a fix for this soon.