Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Script to make new folders in the finder ?

  • Script to make new folders in the finder ?

    Posted by Daniel Crooks on September 11, 2009 at 7:29 am

    hi

    I have a script that is setting up a stack of comps and then queing them to be rendered. Normally i’d be ok to render 30 or so movies into a folder but the problem is I now want to use DPX sequences instead of quicktime movies. each of the sequences are 20000+ frames so I need to put each sequence into it’s own folder. I can’t work out a way for the script to create a new folder for the render location filepath. I tried simply adding it into the output filepath but of course came back with an error saying that folder doesn’t exist. Is it even possible to create/delete folders via the script ?

    cheers../daniel

    Dan Ebberts replied 16 years, 2 months ago 3 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    September 11, 2009 at 11:34 am

    You should take a look at the Folder object constructor section in Adobe’s JavaScript Tools Guide, but basically it’s like this:

    myFolder = new Folder (theFolderPath);

    Dan

  • Daniel Crooks

    September 14, 2009 at 11:44 am

    hi Dan

    thanks for pointing me onto the Javascript Tools Guide, I’ve been plodding along with the After Effects scripting guide which is a bit thin on the basics. All up running sweetly now.

    cheers../ Daniel

  • Adam Ghering

    April 18, 2010 at 2:19 am

    Ok so I have tried numerous ways to create a folder on the drive with no luck…every time I use the examples that people have posted it doesn’t work. I have tried your above examples but I still have no luck. this is what I have tried

    myfolder = new File(“c:\\Newfolder\\”);

    didn’t work so I found a command in the java script toolkit and tried this

    Folder.create(“c:\\Newfolder\\”);

    this gives the error that Folder.create is undefined so I tried this

    myfolder = new File(“c:\\Newfolder\\”);
    Folder.create(myfolder);

    still no luck

    also
    myfolder = Folder.create(“c:\\Newfolder\\”);

    some of the examples seem to run without errors but there is no folder created in the directory.

    What am I missing.

  • Dan Ebberts

    April 18, 2010 at 1:51 pm

    Try it this way:

    var myFolder = new Folder(“/c/Newfolder”);
    myFolder.create();

    Dan

  • Adam Ghering

    May 19, 2010 at 11:56 pm

    Thank you Dan…that worked

    What about creating a wildcard for looking for a script like

    /c/user/*.jsx

    and having the script return whatever it .jsx it finds there.

    thanks,

  • Dan Ebberts

    May 20, 2010 at 12:04 am

    Try this:

    var myFiles = myFolder.getFiles(“*.jsx”);

    Dan

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