Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Script to import footage’s folder in a Composition.

  • Script to import footage’s folder in a Composition.

    Posted by Dario De angelis on September 28, 2016 at 1:26 pm

    Hi guys, I was trying (helping with some past thread) to write a script to import an entire folder’s footage in my composition, but for now i’m only be able to import a single file in my project (and not in composition), can someone help me?

    This is the code that I wrote:

    var path = "D:/MYFILEPATH/MYFILE.MOV";
    var io = new ImportOptions(File(path));
    var proj = app.project;
    proj.importFile(io)

    How can I convert this to import all folder’s file and insert it in a specified Comp?

    Walter Soyka replied 9 years, 7 months ago 2 Members · 4 Replies
  • 4 Replies
  • Walter Soyka

    September 28, 2016 at 2:08 pm

    What’s your familiarity with scripting?

    Your code imports only a single file, D:/MYFILEPATH/MYFILE.MOV, because that’s all that you specify.

    Without writing the code, here’s a rough list of the steps you have to take:
    – Select a folder
    – Get a list of all the files in the folder
    – Step through the list and import each file into the project, saving a list of the project items you import
    – Create or locate a comp
    – Add new layers to the comp using the list of new project items as the sources

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Dario De angelis

    September 28, 2016 at 2:20 pm

    I don’t need to determine the order; the lenght and the framerate are pre-set (the footages are some shots of football players on green screen).

    I only need to know if there is an expression/script that, in case, I could apply to display or not the layers if their filename match with text.

    What I would do is to create a template where I only need to put the file in my directory and write the filename on my text layer to display it.
    (Now I used to apply to every footage an opacity’s expressions to display it in case the name match)

    So I thinked to this solution.

  • Dario De angelis

    September 28, 2016 at 2:37 pm

    Not so much familiarity, i’m trying in these day to experiment with expressions and scripts.

    I know that my code imports only a single file, but I don’t know how to change the path to import all folder files (if I don’t write “MYFILE.MOV” at the end of the path, it give me path’s error).

    I will try to follow your instruction.

  • Walter Soyka

    September 28, 2016 at 2:55 pm

    [Dario De Angelis] “Not so much familiarity, i’m trying in these day to experiment with expressions and scripts.”

    The CS6 scripting guide is a tremendous resource:
    https://www.adobe.com/devnet/aftereffects.html

    For your specific task here, take a look at the “Smart Import.jsx” script that ships with After Effects.

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy