How do you duplicate() a footageitem?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
Posts: 2
Joined: September 19th, 2019, 3:40 pm

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?
Posts: 9
Joined: February 8th, 2008, 4:39 am

Here is a bit of a hack that works in CC2014 & CC2015 (and onwards, probably..).
( From: ... 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
A more accepted way would likely be to get the file path(s) and import the file(s) on more time:

Code: Select all

 // For a single file:
var myFootage = app.project.item(3); // Hard-coded 
myFootage.selected = true;
var selectedFootagePath = myFootage.file.path + "/" +;
var duplicatedFootage = app.project.importFile(new ImportOptions(File(selectedFootagePath))); = + " DUPLICATED";
Post Reply