Page 1 of 1

Copy composition from one project to another using script

Posted: April 23rd, 2018, 1:38 am
by chaitally
Hi,
I have two project files - proj1.aep anf proj2.aep
proj1.aep already has a master comp containing other comps. Now what I would like to copy the comps from proj2.aep to the master comp in proj1.aep and render the master comp. This is to be done using script (.jsx files).

I have imported proj2.aep in proj1.aep but do not know how to proceed further. Below is my code:

Code: Select all

app.beginUndoGroup('Automagic');
var aep_file = new File('./prj01.aep');
var srcProj = app.open(aep_file);

var myFolder = new Folder("~\\Desktop\\test");
var myFiles = myFolder.getFiles("*.aep");
var myImportOptions = new ImportOptions();
myImportOptions.file = myFiles[0];
srcProj.importFile(myImportOptions);

srcProj.close(CloseOptions.SAVE_CHANGES);
app.endUndoGroup();


The above code imports proj2.aep to the proj1.aep. But I do not know how do I add the comps in the master comp's timeline for rendering.
Please help me.