FORUMS: list search recent posts

copy files

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Fabio Apelbaum
copy files
on Jun 17, 2016 at 6:23:15 pm

Hi guys!

I been putting together a script to expedite a very long and recurrent process. It includes copying files from one OS folder to the project OS (footage) folder, importing such files into the AE project and adding them to my comp, I would like for all of this to happen within the same script.

Everything the way I have written in my script seems to work fine, but I did notice couple of things.

When copying the files from one folder to another, it takes a very long time in comparison to if I would do a manual copy paste.

For this, I am currently using the following function:

function copyFiles(source, targetFolder){
var source = new Folder(source);
var targetFolder = new Folder(targetFolder)

var theFolder = targetFolder.getFiles();
for(var c = 0; c < theFolder.length; c++){
if (theFolder[c] instanceof Folder){
if(theFolder[c].name == "NETWORK_BUGS"){
targetFolder = theFolder[c];
var sourceFiles = source.getFiles();
for(var i = 0; i < sourceFiles.length; i++){
if(sourceFiles[i] instanceof File){
filesToCopy = sourceFiles[i]
filesToCopy.copy(new File(targetFolder+"/"

Is there a better way to do this so it can copy as fast as if I was to do it manually?

Also, I noticed, that this process only runs when I have ExtendScript set to run from ExtendScript, but if I set it to run from within After Effects together with the rest of the script that does the other steps within AE, it does not seem to work.

Thanks for any advice!!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 All Rights Reserved