My script performs a number of actions on selected clips, such as conforming their frame rates. I would like the user to have the option of keeping the original footage intact, and instead perform these actions on a set of copies. However, the .duplicate() method appears to be available only to compitems.
Is there a way to duplicate footageitems as you would by pressing command (or control) D in the project panel?
How do you duplicate() a footageitem?
Moderator: Paul Tuersley
Here is a bit of a hack that works in CC2014 & CC2015 (and onwards, probably..).
( From: https://www.provideocoalition.com/after ... mmand-ids/ )
You would have to check if the command ID is valid for other AE versions..
A more accepted way would likely be to get the file path(s) and import the file(s) on more time:
( From: https://www.provideocoalition.com/after ... mmand-ids/ )
You would have to check if the command ID is valid for other AE versions..
Code: Select all
app.executeCommand(2080); // Equals Edit -> Duplicate
Code: Select all
// For a single file:
var myFootage = app.project.item(3); // Hard-coded
myFootage.selected = true;
var selectedFootagePath = myFootage.file.path + "/" + myFootage.file.name;
var duplicatedFootage = app.project.importFile(new ImportOptions(File(selectedFootagePath)));
duplicatedFootage.name = myFootage.file.name + " DUPLICATED";