What does it do
Copies a project folder to the current OpenFinder window and renames the top level folder and the After Effects folder found within it.
All you need to do is change the sort path at the top of this code to match wherever your project folder is. Then, save the script file as an application to your applications folder.
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.
-- 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