Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Scripting Question 2…

  • Scripting Question 2…

    Posted by Erin Shelby on September 29, 2005 at 11:48 pm

    Dan, I’ll assume… 😛

    After I use “importFileWithDialog()” to import an file, an image lets say, how can I store the value of that item (the item number) as a variable? After I import an image, I would like to place it in a layer, so…

    myImage = myComp.layers.add(freshlyImported);

    -echo
    PS: I can clarify upon request

    Dan Ebberts replied 20 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    September 30, 2005 at 12:18 am

    Well, strangely enough, once you import a footage item, you actually have to loop through all the items in the project window and find it before you can add it to a comp. Something like this:

    myPath = imageFolderPath + imageFile;
    myImageFile = File(myPath);
    myImportOptions.file = myImageFile;
    myFootage = myProject.importFile(myImportOptions);

    n = myProject.numItems;
    for (j=1; j<=n; j++){ if (myProject.item(j).name == imageFile){ myNewFootage = myProject.item(j); break; } } myImage = myComp.layers.add(myNewFootage); Dan

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