ExtendScript - Import individual compositions from .aep-Projects
Copy link to clipboard
Copied
Is it possible to import individual Compositions from a external .aep-Project?
It is very easy to import a complete Project-Folder with
app.project.importFile(new ImportOptions(projectFile));
but what if i would like to iterate through the compositionsof the desired project, i.e. searching for a composition by a specific compositionName that will be imported to the project.
Copy link to clipboard
Copied
That's not possible out of the box.
You'd need to save your comps as individual projects first, by using Save Comp as Project https://aescripts.com/save-comp-as-project/ or by converting each composition into an executable JSX code with compCode https://aescripts.com/compcode
Cheers.
Copy link to clipboard
Copied
you could import the project and then delete all unneeded items.
Copy link to clipboard
Copied
Tom's is the easiest approach for a user-based solution, Shachar's is the most straightforward way with the core API.
If you're up for a challenge, you can look into AEPX files, which are basically After Effects files saved as XML. If you had your original files saved as AEPX, you could find the comp you want and generate a new file with just that comp, and then import it. This is undocumented and takes some trial and error.
Copy link to clipboard
Copied
If you don't know in advance which comps from which projects you need to import, shachar carmi's suggestion (import the entire project and delete all unneeded items) is the only option. You need to make sure to not delete precomps that are part of the comp you want to keep. Hence deleting is probably done best using the Reduce Project menu command using app.executeMenuCommand.
So the steps would be
- save your project
- open the project you want to import the comp from
- select the comp you want ot import and Reduce Project
- save project with a new name
- open original project from step 1 again
- import project saved in step 4
Copy link to clipboard
Copied
did you find any solution my friend ??

