Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Extendscript question in AE CS5?

  • Extendscript question in AE CS5?

    Posted by Billy Sides on October 4, 2011 at 8:07 pm

    I’m trying to create a script in AE CS5 extendscript. I’m haveing a little trouble getting some code to work, can anyone tell me what is wrong with this code? Am I missing something? I want this to execute when a button is clicked.

    file.copy("E:\Work\CopyFile\*.*", "E:\Work\toHere");

    Thanks for your help,

    -bsides

    Billy Sides replied 14 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 4, 2011 at 9:01 pm

    Try it this way:


    {
    var sourceFolder = new Folder("/E/Work/CopyFile");
    var destFolder = new Folder("/E/Work/toHere");
    var sourceFiles = sourceFolder.getFiles();
    var myFile = new File();
    for (var i = 0; i < sourceFiles.length; i++){
    myFile = sourceFiles[i];
    myFile.copy(destFolder.path + "/" + destFolder.name + "/" + myFile.name );
    }
    }

    Dan

  • Billy Sides

    October 5, 2011 at 2:23 pm

    Dan, That works perfectly! Not sure if you’ve ever heard this, but… Dan you are the man!

    I’m fairly new to this so your help is greatly appreciated. If you have time could you breifly explain what the differences are in the two lines of code. Why one works and why the other one failed so miserably. I think it would help us newbies tremendously.

    Thanks again Dan,

    -bsides

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