AG_direcToy is an After Effects folder creation tool which employs predefined templates to build folder structure for multiple shots. It is part of the AG_goBOX suite of tools, designed to assist ingest, and setup folder structure for different creative projects, and turn After Effects into an essential toolkit in the production pipeline.
After launching the floating palette, double click on any existing preset in the list, and a dialogue will prompt you for a location. The script will next build a series of directory folders matching the template on your hard drive in the specified location, and avoid replacing any existing folders. Pre-existing folders with matching names are skipped.
If the Selected Shots checkbox is active, choose files, folders, or solids in After Effects, and double click on any existing preset in the list. A dialogue will prompt you for a location, and then the script will build a series of directory folders based on the selected item name using the template for the number of files you have selected.
Clicking the Edit Presets button opens a dialogue which allows a template to be saved, or modified.
Clicking the Edit Filters button opens a dialogue which allows a filter to be saved, or modified.
Defining a Template Preset
The template file is not included, but default presets are baked into the software. You must save a new preference file once you open the project, and it will override the built in system templates.
To build a new preset, select all the folders within a hierarchy in the After Effects project window, and click on Make Preset. This will read the relationships and names of the folders, and build a preset matching the text in the floating dialogue box.
The hashtag, or pound sign (#) is a wildcard that will be replaced by the selected item name when executed. This hashtag can exist at any point in a template element, and it will be replaced. The example below:
Each line above represents a new folder, and its place in the hierarchy. Select all these folders to define the preset.
While in the main panel, selecting an item called “myShot”, and double clicking on the resulting preset with the Selected Shots checkbox active — builds a series of folders with the name shot1_myShot as the first folder, and so on.
Remove a Preset
The Remove Preset button deletes the selected preset, and the Rename button modifies the selected filter to match the text in the edit text field.
Testing a preset
While in the presets editing panel, double clicking on a defined template will build a series of folders in the project window, with the word “test” added to the end. This allows testing before actually writing files to the disk. These folders can also be modified to build new templates.
Defining a Filter
The script uses a series of filters to modify the incoming filenames to properly name the folders. It is possible to rename all the files directly for the desired output, but it is far more efficient to use filters to analyze the file names, if all your input is consistent. The filters use a regular expression engine to replace, remove, or add text while creating the folders from the selected file text. These filters are also user defined, to work in naming structures from existing pipelines. Please see Filter Template Structure below.
To build a new filter preset, select the Edit Filters button to open a new dialogue. Type in a filter in the text box following the filter conventions noted in the Filter Template Structure, and click the Add Filter button.
Each filter must have at least three components: The on/off switch, the function, and the pattern separated by colons(:) or the filter will not be created. See Filter Template Structure below.
The Remove Filter button deletes the selected filter preset, and the On/Off button toggles the filter to be active or inactive.
The On/Off button toggles whether or not the selected filter is active.
Double clicking on any filter will copy its text into the filter editing field, so you can modify the code and save a new filter to the list.
The Save Prefs button creates a text file on your hard drive in the same folder as the script — named AG_goBoxPrefs.txt. This can be edited later if necessary. It is recommended that any script from the AG_goBOX collection be in the same folder, so that this file can be combined with other script preferences. Storing the preset in this file, and not the standard Adobe Preferences is intentional, as the script is designed to work in environments where the Adobe Preferences files is not available to the user.
Preset Template Structure
If you have to edit your preferences file directly, this guide explains the template structure.
A template is stored in an array, and follows basic unix-style nomenclature to define its relationship to other folders.
G_dt.foldLst = [“Master Project”,”#_master_proj”,”source_files”,”/source_files/elements_#”,”/_reference”];
This example G_dt.foldLst is the array name (G_dt), and the first template folder in the list,  would be the second, and so on. This format must be followed for this to be properly read by the tool.
Each element of this array is bracketed in quotes, and separated by a comma, and must be enclosed with a square bracket () and terminated with a semi-colon (;). The hashtag, or pound sign (#) is a wildcard that will be replaced by the selected item name when executed. This hashtag can exist at any point in a template element, and it will be replaced.
Each element uses standard unix-style notation to identify new folders, and their parent relationship. Each child must contain its entire relative file path within its entry. The second element of the array will be created in your selected location, and all others created relative to that point.
If we have a selected file, solid, or folder in the project window named “Shot1,’ double-clicking on the example template would create the following file structure in your target folder on the hard disk:
Filter Template Structure
Filters modify the incoming names from which folders are created. These are stored in a text array. Often in facility pipelines, there is a lot of information stored in a file name, but the information you need to build folder structure is only a portion of that. So rather than rename all the files in the After Effects Project, filters provide a similar function.
The first element of a filter is the on/off flag. It determines whether or not the filter will run during execution. A colon (:) separates following arguments.
The second element of a filter identifies its function. rem = remove, add = add, and rep = replace. The filter uses the regular expression to modify selected names.
The filter recognizes any regular text string, but also uses these regular expressions for greater flexibility. Regular expressions can be text, symbols, or certain combinations of these as logic operators — the only exception being the colon (:) which is used for splitting the arguments, and is rarely part of a filename.
As an example, the filter “rem:[s]:@“ will remove every whitespace in a name, and replace it with the @ symbol. Regular expressions are more powerful filters, but can become unruly in certain circumstances. Consult any online manual on RegExp for more information, also look for any RegExp testers on the internet, to experiment building required regular expressions..
If the on/off switch is active, so is the filter. If you have specific filter groups combinati