Expressions/Scripts/Presets

Moderator: Paul Tuersley

 
chaitally
Topic Author
Posts: 1
Joined: Sun Apr 22, 2018 11:11 pm

Copy composition from one project to another using script

Mon Apr 23, 2018 1:38 am

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:
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.

Who is online

Users browsing this forum: No registered users and 4 guests