New AE Project

Apple Script
April 28, 2025
-- Define the source folder path
set sourcePOSIXPath to "/put your path here"

-- Convert POSIX path to alias, handle errors if the path is incorrect
try
	set sourceFolder to POSIX file sourcePOSIXPath as alias
on error
	display dialog "Source folder not found at path:" & return & sourcePOSIXPath buttons {"OK"} default button "OK"
	return
end try

-- Get the destination folder from the frontmost Finder window
tell application "Finder"
	-- Check if any Finder window is open
	if (count of Finder windows) is 0 then
		display dialog "No Finder window is open. Please open a Finder window and try again." buttons {"OK"} default button "OK"
		return
	end if
	
	-- Get the target of the front Finder window
	set destFolder to target of front Finder window as alias
end tell

-- Copy the source folder to the destination
tell application "Finder"
	try
		-- Duplicate the folder
		set copiedFolder to duplicate sourceFolder to destFolder with replacing
	on error errMsg
		display dialog "Error copying folder:" & return & errMsg buttons {"OK"} default button "OK"
		return
	end try
end tell

-- Prompt the user for a new name
display dialog "Enter the new name for the project:" default answer ""
set newName to text returned of the result

-- Rename the copied folder with the user-provided name
tell application "Finder"
	try
		set name of copiedFolder to newName
	on error errMsg
		display dialog "Error renaming folder:" & return & errMsg buttons {"OK"} default button "OK"
		return
	end try
end tell

-- Rename the After Effects project file inside the copied folder
tell application "Finder"
	try
		-- Access the renamed copied folder
		set renamedFolder to folder newName of destFolder
		
		-- Access the "3. Project files" subfolder within the renamed folder
		set projectFilesFolder to folder "3. Project files" of renamedFolder
		
		-- Access the After Effects project file
		set projectFile to file "New Project.aep" of projectFilesFolder
		
		-- Rename the project file to match the new folder name with .aep extension
		set name of projectFile to (newName & ".aep")
	on error errMsg
		display dialog "Error renaming After Effects project file:" & return & errMsg buttons {"OK"} default button "OK"
		return
	end try
end tell

This script it is quite custom to the way that I've organized my project folder and includes a part to do with renaming the sub-ae file. If you want to remove this, or have any trouble, drop it into a language model and ask it to help you.

This AppleScript copies a folder from a specified source path into the currently open Finder window’s folder, prompts the user for a new project name, renames the copied folder accordingly, and then renames an After Effects project file inside a specific subfolder (3. Project files) to match the new name. Error handling is included at each step.

  • Define source folder: Sets a source folder path manually in the script.
  • Validate source: Checks if the source folder exists; shows an error if not.
  • Get destination: Takes the target folder from the frontmost Finder window.
  • Copy folder: Duplicates the source folder into the destination.
  • Rename folder: Prompts the user for a new name and renames the copied folder.
  • Rename project file: Locates "New Project.aep" inside 3. Project files and renames it to match the new folder name.

How to use the script

Always check code before running it on your computer. Even basic scripts like this one. If you’re not a developer, ask an LLM like ChatGPT, Claude, or Gemini to verify it for you.

Option 1: Install to your AE Folder

Download and install the below .jsx file in your After Effects Script folder. You can then run it using the scripts menu, or by using a launcher like Quick Menu 3.

Option 2: Adapt the script yourself

Alternatively copy the code below and develop your own version. If you’re not a developer you can do this easily with an LLM like ChatGPT.

Research, interviews, and tools for modern motion designers.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.