-
Import video into comps script
Hi all,
Let’s say we have three comps in the project panel, named “Lorem”, “Ipsum” and “Dolor”.
Let’s also say we have three video files (.movs) imported into the project panel named “Lorem”, “Ipsum” and “Dolor”.
I want to run a script which will add the video file named “Lorem” to the comp named “Lorem”, the the video file named “Ipsum” to the comp named “Ipsum” and the video file named “Dolor” to the comp named “Dolor”.
It’s important to note that the comps will already have been made, they are just lacking the relevant video files.
There could be three files like in this example or there could be hundreds.
So far I have this:
var myProject = app.project;
for (var i = 1; i <= myProject.numItems; i++){ if (myProject.item(i) instanceof CompItem){ var myComp = myProject.item(i); } if (myProject.item(i) instanceof FootageItem){ var myFootage = myProject.item(i); } if (myComp.name == myFootage.name){ myComp.layers.add(myFootage); } } It works, but is it what you guys would do?