Batch Search-n-Replace Paths


Version: 1.51 Sign up to be notified by email when a new version of this script is posted
This script will batch process folders of After Effects projects and searches and replaces all the contained footage file paths. This can come in handy if you are moving a project (or many projects) to a different folder structure like a new server. You can also use it to batch replace files in many projects at once.
The script has 2 operating modes:
- An old school method which opens each project, checks all the footage items paths then replaces the path to the new path, imports the footage item from the new location and saves out a new project. This method works with CS3 & CS4.
- The faster and preferred method takes advantage of the new XML file format introduced in CS4. It opens each project, saves it out as an XML project (if original project is already in .aepx format then this step is skipped) and then does a search and replace on the XML file. This process is much faster since it doesn’t have to import all the footage items and it will preserve all the interpretation settings for every footage item.
USAGE:
- It is recommended that you run the script in test mode first to see how After Effects sees the footage paths. Once you have that info you can accurately enter the search and replace strings. Note that on Mac XML projects path are separated by a colon : )
- The project name match field allows you to enter a match string so the script will only work on projects whose name matches the string (you can use Regex if you turn on the option below).
- If you use a project name match string you can enter a replace string for the new project name or just add a suffix or a prefix to be appended to the new project name.
- Recurse subfolders will process and subfolders.
- Use Regex will cause the script to use Regular Expressions syntax in the search string. If you don’t know what Regular Expressions are then it’s probably best that you don’t use this option.
- Generate log will create a text file with all the results and errors encountered by the script.
- If you are running in test mode you will be able to preview the search and replace results before actually doing it. The script will save a text file with the results of the search and replace operation.
Version History
- 1.51 fixed path separator on mac CS5 – 06/2010
- 1.5 – 05/2010
- Added option to have more than 1 search replace pair
- Added search replace option to project name
- Blessed for CS5
- Small bug fixes
- 1.03 Fixed Log location help tip – 01/2010
- 1.02 Fixed “Suppress dialogs” bug – 01/2010
- 1.01 Fixed “undefined” error when write to network preference was not set – 11/2009
- 1.0 Initial Release – 11/2009
- Batch Search-n-Replace Paths UI









what you do is really a wonderful job!love your website
Can the script Search-n-Replace and also change the extension?
I need to batch replace a bunch of AVI files with Quicktime equivalents
Oh, it seems like it does! Yey!
This is a great idea, but I get the “undefined” error when I try to run it.
I’m using CS4 9.0.2.42 on windows XP
Is there any way to get it running?
Fixed the “undefined” error. Please re-download and let me know how it works for you. It was a small error with the dialog box that warned that you need to have the “Allow Scripts to Access Network” preference set to run the script.
Hi! I used the script with the “Use XML project” option selected. The log stated that 12 files were successfully replaced. When I opened the updated .aepx file I was prompted with the following warnings:
After Effects error: No element found
( 83 :: 2 )
After Effects warning: Unknown BIB Error. No element found, AXEParser, 1003
( 83 :: 3 )
After Effects warning: Unable to import file ‘something_updated.aepx’ as project.
Any ideas as to what happened during the replace? There were no errors reported in the log file.
An observation to note:
No paths are replaced when I execute the script on the same project file with the same search string and WITHOUT the xml option selected.
Thank you for any assistance with this issue.
There was a small bug in the way xml paths were handled on mac CS5 which is now fixed in v1.51
this script (even the CS5) version does not work properly in Mac OS with CS5, at least with Snow Leopard. It seems that CS5 no longer saves path delimiters as “:” in aepx. It uses “/” now. I just commented out the part in your script that makes the auto-conversion from / to : and it works fine. Thanks for the script!
You are absolutely correct. v1.51 fixes that oversight.
In CS3 (Mac os 10.5) I get the error “Unable to execute script at line 568. Illegal use of reserved word.”
Any idea what this might be?
The CS3 version was accidentally excluded from the archive in the latest update but that has been corrected. The archive now includes 2 scripts. A CS3 version and a CS4 and above version. Of course the xml option is only available in CS4 and above and is the highly recommended option to use.
I really like the updated feature of allowing for multiple search/replace pairs.
I wish I had this functionality months ago.
…Would have saved hours(days!) of exporting each pair individually.
Terrific!