Page 1 of 1

Default Folders

Posted: June 16th, 2004, 3:10 pm
by Impudent1
This set of scripts is basically the same script modified to work in one of three ways, depending on preference.

The main gist of the script is to create a set of default folders . It will take a predefined array of folder names. It will loop through a: renaming solids dir->creating new layer to get new default solids dir->rename that dir->delete unused layer then rename the existing solids folder back cycle. ... tartup.jsx

is for use on starting AFX and goes in the scripts\startup folder. ... olders.jsx

is the same script minus the app.newProject(); line , as its not needed if not used on startup. This script can be safely used in existing projects . ... dersUI.jsx

is modified further to open up a dialog box with edit text fields containing the default folder name structure, esc/cancel and ok/return.

The known catch to these is that if you create a solid that creates the
default "Solids" folder, then using the history, undo. It will only undo the
solids creation not undo the "Solids" folder creation (hence on the UI
having the control events allowing cancel)

Posted: June 23rd, 2004, 11:40 pm
by pixelbot
so i am trying the startup version of the script and after it build the folders it ask if I want to save before closing - so if I save the project, AE opens up a blank project and in order to use the newly created folders I need to cancel. Is there away to not have AE close the newly created project.


Posted: June 24th, 2004, 3:22 pm
by Impudent1
The startup one is meant to go in the scripts/startup folder vs being run once the application is running, DefaultFolders or DefaultFoldersUI are safe to run from the running application without messing with the existing project.

the line that you need to get rid of to answer the question tho is :


that will prompt to save the open project


Posted: June 24th, 2004, 5:09 pm
by pixelbot
the script is in the startup folder (sorry I wasn't clear) but after it creates the folders it wants to close the newly created project. and if you get rid of the line: app.newProject(); you will get a javascript error.


Posted: June 24th, 2004, 7:35 pm
by Impudent1
hmm interesting, it works here on 3 machines all windows flavor. As well you are correct that line is needed for it to work when ae starts up.

Do the other two run ok there?

Posted: June 24th, 2004, 7:53 pm
by pixelbot
both other flavors work as advertised - I wonder if AE 6.5 on the mac does things in a different order when starting up.

hey I have a question does the windows version of AE 6.5 open up a blank project when you start it up?


Posted: June 25th, 2004, 5:11 pm
by Impudent1
well if the others work I am assuming it is something with the line:


your asking about how windows starts with untitled project leads me to see if this makes any difference on the mac side

could you try replacing lines 8-15 ( from after undo group line to above the array declaration) with this snippet?

if (app.project != null) {
app.project.showWindow(true); //set the project window active
} else {

app.newProject(); //creates a new project to open AE into

app.project.bitsPerChannel = 16; //sets the project bit depth

I will have to check and see if I can just do this snippet and make the non ui work both ways in one script :)

Posted: June 27th, 2004, 7:59 pm
by pixelbot
I tried it and it still didn't work I'm actually thinking it is something at the end of the script that causes the newly created project to close - or that the mac version of AE closes it for some reason thus prompting the "do you want to save before closing" dialog box.

sorry I can't be of more scripting help.


UpDated versions

Posted: June 30th, 2004, 5:03 pm
by Impudent1
Well thanks to a lot of input from Paul Tuersley there are new versions that should take care of the mac issue as well as some other little things I missed.

These now use the prefs file to store your foldernames and allow you to create "up to" 6 default folders.

if you have the older versions, please remove them from the scripts and scripts/startup folders.

This update is only two files: The UI version which is used to set/modify your folder name preferences, blank name being no folder is created. This file should be put in the default scripts directory as it is referenced by the standard script. ... I_v1_8.jsx

The standard script can be put in either/both the default scripts directory as well as the scripts/startup directory. As mentioned the UI is called on first run to set the default folder names, so if you have custom folder structures you will have to modify to fit ... s_v1_8.jsx

Posted: July 1st, 2004, 9:56 pm
by pixelbot
thanks that works great - I appreciate you tracking this down and thanks to Paul T. You guys are great.


I edited it to make an 8 bpc project - and my 3 favorite folders

Posted: September 3rd, 2004, 4:48 pm
by aswaab
I think your script is great. I'd love to be able to create subfolders as well with it. Can you tell me how I would go about doing this?

Posted: September 5th, 2004, 4:47 pm
by Impudent1
Well thanks for the positive feedback :)

I sadly have not been able to figure out how to make it do subfolders. In a nutshell this script works by using the solid creating a default solids folder. That means that it will always create it as a base folder in the project window, no matter what you have set as the activeItem.

I had thought it might be able to be gotten around by duplicating the folder but duplicate as well as cut/copy/paste are disabled in the AFX interface so I am assuming they are unavailable by scripting actions.


Posted: October 13th, 2004, 5:34 pm
by payal1711

This is awesome. DefaultFoldersStartup.jsx is the type of feature I was looking for.

Thanks a bunch!


Re: Default Folders

Posted: June 26th, 2018, 1:50 pm
by zlovatt
Prompting discussion on ae-list, I've rebuilt the DefaultFolders script to work a little bit differently. This way

If installed to ScriptUI Panels, and run via Window > DefaultFolders:
  • You'll see a UI where you can specify folder names, and some buttons.
    "Create" will create folders matching the UI, and save the names you've entered to prefs
    "Reset" will reset the UI names to default
If installed to the Startup or Scripts folder and run on launch (or via File > Scripts):
  • Folders will be created matching saved prefs