An After Effects script that cleans up the Project panel: every item gets sorted into a folder by type, and numbered sets get their own subfolder.
Safe to re-run — new imports fall into the folders that already exist. Everything happens inside a single undo group, so one Ctrl/Cmd + Z puts it all back.
Before
Project
├── Lower Third
├── Lower Third 2
├── Lower Third 4
├── A001_C003.mov Comp 1
├── A001_C003.mov Comp 2
├── IMG_4521.MOV
├── IMG_4521.MOV
├── IMG_4521.MOV
├── Main Comp
├── logo.png
├── VO_take3.wav
└── b-roll.mov
After
Project
├── Comps
│ ├── Lower Third
│ │ ├── Lower Third
│ │ ├── Lower Third 2
│ │ └── Lower Third 4
│ ├── A001_C003.mov Comp
│ │ ├── A001_C003.mov Comp 1
│ │ └── A001_C003.mov Comp 2
│ └── Main Comp
├── Images
│ └── logo.png
├── Audio
│ └── VO_take3.wav
└── Video
├── IMG_4521.MOV
│ ├── IMG_4521.MOV
│ ├── IMG_4521.MOV
│ └── IMG_4521.MOV
└── b-roll.mov
Grouping is by base name only — the numbers just have to be there.
| Case | Result |
|---|---|
Lower Third 2, Lower Third 4, Lower Third 9 |
One Lower Third folder. Gaps don't matter, and the set doesn't have to start at 1 |
Lower Third (no number) |
Read as the 1 and filed with its set |
Title_02, Scene-3, Shot04 |
All the common separators work |
A001_C003.mov Comp 1 on its own |
Left alone. A set of one isn't a set — it gets a folder the run after a Comp 2 appears |
render (1), export [3] |
Bracketed indices count too |
20250614 |
Skipped — a pure number has no base to name a folder after |
0628.mp4 |
Extensions are stripped before the number is read, so the 4 in .mp4 is never mistaken for an index |
Eleven identical IMG_4521.MOV entries |
One folder under the full name. Replacing clips with AE comps from Premiere leaves piles of these |
IMG_4521.MOV × 11 beside a lone IMG_4530.MOV |
Identical names win over a shared base, so the eleven copies get an IMG_4521 folder rather than everything landing in a generic IMG bucket |
Matching is case-insensitive and trims whitespace, but it's a whole-name match. Lower Third joins Lower Third 2; Lower Third old doesn't, since that's a different comp rather than a member of the set.
- New items at the project root drop into their existing category folder.
- A new
Lower Third 5joins the existingComps/Lower Thirdfolder instead of starting a second one. - A lone item that finally gets a sibling is grouped on the next run.
- Anything already inside a group subfolder is left exactly where it is.
- Your own folders — and AE's auto-created "Linked Comp" folders — are never touched, unless you tick Also pull items out of other folders.
| Folder | Contents |
|---|---|
Comps |
All compositions |
Images |
png, jpg, tif, tga, exr, dpx, webp, hdr, … |
Design Files |
psd, psb, ai, eps, svg, pdf |
Video |
mov, mp4, mxf, mkv, r3d, braw, … |
Audio |
wav, mp3, aac, aiff, flac, m4a, opus, caf, … |
Data |
json, mgjson, csv, txt, xml, … |
Solids |
Solid sources (left alone by default) |
Placeholders |
Placeholder / offline items |
Other |
Anything unrecognised |
Files are matched on extension first. Anything the lists miss falls back to what the media actually is — an item with audio and no video goes to Audio whatever it's called, a zero-duration visual goes to Images. Offline footage is classified from its item name, so it still lands correctly.
As a dockable panel (recommended)
- Copy
OrderAE.jsxinto your AEScripts/ScriptUI Panelsfolder:- Windows —
C:\Program Files\Adobe\Adobe After Effects <version>\Support Files\Scripts\ScriptUI Panels\ - macOS —
/Applications/Adobe After Effects <version>/Scripts/ScriptUI Panels/
- Windows —
- Restart After Effects.
- Open it from Window → OrderAE.jsx.
One-off run
File → Scripts → Run Script File… and pick OrderAE.jsx.
If the panel doesn't appear, enable Preferences → Scripting & Expressions → Allow Scripts to Write Files and Access Network.
| Option | Default | Notes |
|---|---|---|
| Group numbered items into subfolders | On | The graph 2 / graph 4 behaviour |
| Also pull items out of other folders | Off | Full resort, including your existing folder structure |
| Leave AE solids where they are | On | AE manages its own Solids folder; unchecking pulls them into the script's |
| Delete leftover empty folders | Off | Cleans up folders emptied by the sort |
Folder names, extension lists, and the grouping threshold sit at the top of the script:
var MIN_GROUP_SIZE = 2; // 2 = a lone numbered item stays put until it has a sibling
// 1 = every numbered item gets its own folder
// items always join a folder that already exists
var FOLDER_NAMES = {
comps: "Comps",
images: "Images",
...
};
var EXTENSIONS = {
audio: "wav,mp3,aac,aif,aiff,...",
...
};ExtendScript (ES3), tested on After Effects CC 2019 and later. No dependencies.
MIT