Batch Search-n-Replace Paths
  • Hi Lloyd, very nice script, thanks

    Just one thing, is there a way to do a replacement of an entire path instead of just folder/file names?
    Sometimes we move from Macs to PCs so the path changes drasticly.

    Thanks again
  • Yes. The search and replace function happens on the full path so you can change as little or as much of it as you want.
  • Hi Lloyd,

    I found two issues when working on PCs (Windows 7).. we found work-arounds, but just thought we'd give you a heads up, if you wanted to make it more PC friendly ;)

    1) If you're source AE project resides on a server (virtual), when you click "DO IT" and then the browser window comes up and you navigate to the folder on the server, it never "selects" it but goes into a loop (re-opens the same window again).  The temporary solution was to just move all of the AE files to be processed to the local hard drive and then move them back.

    2) If you uncheck "Use XML project (faster)" then the slashes on the paths you enter get flipped and you get this result:

    Completion Report for C:\Users\lanenak\Desktop\PATH_RENAME_QUEUE\SMUR_0600_v013.aep

    Search string 1: \\server\data_jobs\dk1500_Sleepy\ASSETS\ART\LAYOUTS\
    Replace string 1: \\server\data_jobs\dk1500_Hollow\
    ---

    1. No match, skipping: //server/data_jobs/dk1500_Sleepy/ASSETS/ART/LAYOUTS/SEQ_0600/Sc010/Sc010_Layout_Scan_v01.psd
    2. No match, skipping: //server/data_jobs/dk1500_Sleepy/ASSETS/ART/LAYOUTS/SEQ_0600/Sc010/Sc010_Layout_Scan_v01.psd


    *The work-around (if we wanted to not use the XML output) was to just reverse all the slashes in paths input into the script window. We figured it must be a mac vs. pc path thing.

  • 1) If you're source AE project resides on a server (virtual), when you click "DO IT" and then the browser window comes up and you navigate to the folder on the server, it never "selects" it but goes into a loop (re-opens the same window again).  The temporary solution was to just move all of the AE files to be processed to the local hard drive and then move them back.

    What do you mean by virtual server? Is it not mounted via SMB or equivalent?  This sounds like an AE bug, can you report it to Adobe?  You can do that here:  http://adobe.com/go/wish

    2) If you uncheck "Use XML project (faster)" then the slashes on the paths you enter get flipped and you get this result:

    Why are you not using XML? Are you working in CS3?  Otherwise I see no reason to not use the XML option, I don't plan on supporting that old CS3 option any longer.

  • Hello,

    This is very a usefull script thank you for it !

    I  have a problem to replace absent footage.

    <Absent>C:\Users\....  Can't be remplaced.

    Thx
    Laurent Panissier
  • You need to give us more details. Are you using the XML option? What are you entering for the search string and what is a sample path?
  • I will try, sorry because my english is not perfect...

    In my company i work with footage who are locate on distante HDD (lan context)...
    And sometimes this lan is deconnected... So i lose the links.

    A use the script to re-afect them with local stuff.

    But in this case when i open my AE file links a broken (absent)...
    It 's here where the script doesn 't work.

    I use this kind of samples :
    - search
    D:\WORKs\GUFF\AFTER
    - replace
    \\HDD1\WORKs\GUFF\AFTER

    Script options are default, XML is active...

    OK ?

    thx
    LP 
  • I would recommend you use Immigration for this instead
  • Does this work for photoshop source files with multiple layers as well? I have two PSDs with the exact same layer structure. When I batch search and rename it's losing all the sub layers and replaces it with the new PSD but each specific layer is replaced repeatedly by the merged PSD. (PSD1/layerA & PSD1/layerB) becomes (PSD2 & PSD2)
  • No, photoshop layers are not supported. 
  • I'm downloaded the script for CS6 but when I try to run it, the script is greyed out so I can't run it. The website says it is compatible with CS6 andy idea what I'm doing wrong?
  • Where are you installing it and how are you running it? Have you consulted the installation faq?
  • Hi Lloyd,

    this script is very nicely designed but I clearly misunderstood its purpose. I am cleaning up a media database at a company which is in extreme disarray. I thought that "Batch Search-n-Replace Paths" would somehow influence the files in the finder as well (wouldn't that be great!). As it is, I have been "reveal in Finder"-ing all the media one by one in each project and then moving them to a new folder location specific for that project. I thought "Batch Search-n-Replace Paths" would automate this time consuming process (which it doesn't... or am I missing something?). What is perplexing me though, is why would I need to change the source path of an object in a project without actually moving the footage to the new path location. After I have moved the footage to its new location by hand, all I need to do is re-link one file and Ae updates the path information for all the rest automatically. I now don't know what this script is really useful for.
  • It occurred to me that anyone reading this comment would wonder why I am not just collecting the projects to clean the database. Unfortunately the data base I am trying to reorganize is in its current state because of that method being used constantly by lots of freelancers (like myself) who have very short term interests in getting things done quickly. By manually searching for the footage that is currently actually being used in the several active projects at the moment and moving (not copying (like Collect Files does)) it to a central location, I can reveal which assets on the system are redundant or not in use.
    ... I hope this makes some sense.

    As for "Batch Search-n-Replace" I see it could be useful in migrating assets to a new location with a new file structure deeper than a root and one sub-folder. But seeing as I am currently faced with this type of challenge, I would have to say doing something like that would be madness. I am reorganizing the assets on the system I am working on in as flat a system hierarchy as possible (two sub folders in a root folder, the first for the project and the second for image sequences, assets that are used by more than one project get placed in the root folder). In this way by finding a single asset in the root folder, all missing assets are found automatically in the sub folders. Any assets deeper than two folders are not found, and an asset found in a subfolder will not lead Ae to finding assets above it... I should probably be discussing this in the Ae forum. 

    Cheers, DK   
  • this script is very nicely designed but I clearly misunderstood its purpose.
    Yes, this script is only for batch replacing paths in AE projects not the finder. There are many other tools availbale to do that including many raw unix commands.
  • Hi, would like to buy it. I use AE CC version and I do not see it in the Compatibility. Can it be used in CC version of AE? Thx!! 

    Martijn
  • Hi, would like to buy it. I use AE CC version and I do not see it in the Compatibility. Can it be used in CC version of AE? Thx!! 
    Yes it works in CC. Just updated the COMPATIBILITY chart.
  • Hi Llyod,

    Is there any way to replace a part of the filename rathar than the entire string. I have a series of files for which the version number changes in the filename, eg
    render_1_SW_035_beauty.0001

    changes to

    render_1_RW_050_beauty.001

    Thanks,
    J
  • Hi Llyod,

    Is there any way to replace a part of the filename rathar than the entire string. I have a series of files for which the version number changes in the filename, eg
    render_1_SW_035_beauty.0001

    changes to

    render_1_RW_050_beauty.001

    Thanks,
    J

    Yes of course, that is the intended us of this tool. Please watch the demo video to learn how to use it. If you need help with the RegEx let us know and we'll be happy to help,
  • Hi,

    I'm having two problems with this:

    1) Use XML Project hardly ever works for me - nothing happens until it does from time to time. No biggie, I can live without it.

    2) I'm working with DNG sequences, and as the script is working it prompts me to choose settings for them via Camera RAW. All these sequences (tens or hundreds in a project) already have custom settings and I don't want to touch them at all. Is this something you can fix or is there a workaround?

    EDIT:
    Upon further investigation, Camera RAW shows wrong settings and preview, but after clicking ok everything is fine in the new project file. The only difference is that in the original AEP these settings can be then tweaked from the right starting point (the original settings), whereas in the new AEP you start with Camera RAW defaults / last settings.   

    Best regards
    F
  • Hi,

    I'm having two problems with this:

    1) Use XML Project hardly ever works for me - nothing happens until it does from time to time. No biggie, I can live without it.

    2) I'm working with DNG sequences, and as the script is working it prompts me to choose settings for them via Camera RAW. All these sequences (tens or hundreds in a project) already have custom settings and I don't want to touch them at all. Is this something you can fix or is there a workaround?

    EDIT:
    Upon further investigation, Camera RAW shows wrong settings and preview, but after clicking ok everything is fine in the new project file. The only difference is that in the original AEP these settings can be then tweaked from the right starting point (the original settings), whereas in the new AEP you start with Camera RAW defaults / last settings.   

    Best regards
    F
    This sounds like an After Effects bug which you should report to Adobe. You can do that here: http://adobe.com/go/wish

  • I've checked if the problem occurs if I replace footage manualy, and to my surprise it does in 13.5. So it was a bug in Camera RAW. They fixed it in 13.6. Unfortunately, when I use the script after the fix the problem's still there. I'll file another bug report, but could you also look into this?

    Best regards
    F
  • I've checked if the problem occurs if I replace footage manualy, and to my surprise it does in 13.5. So it was a bug in Camera RAW. They fixed it in 13.6. Unfortunately, when I use the script after the fix the problem's still there. I'll file another bug report, but could you also look into this?

    Best regards
    F
    Can you open a support ticket and provide the file you fixed manually and the one that the script produced so we can take a look? Also provide the unchanged project file so we can run some tests.
  • I've checked if the problem occurs if I replace footage manualy, and to my surprise it does in 13.5. So it was a bug in Camera RAW. They fixed it in 13.6. Unfortunately, when I use the script after the fix the problem's still there. I'll file another bug report, but could you also look into this?

    Best regards
    F
    Can you open a support ticket and provide the file you fixed manually and the one that the script produced so we can take a look? Also provide the unchanged project file so we can run some tests.
    Eh ... Mystery solved i think. I wanted to point the footage paths to duplicate files on a backup drive. Some of these files were probably backed up BEFORE they were touched by Camera RAW, and since Camera RAW stores its settings in the DNGs themselves (of which I didn't know) ... no joy. Interestingly enough, your plugin managed to keep the right interpretation in the image right up to the point of revisiting RAW settings. I'll do some more test, but it looks like that's that. Thank you and sorry for the trouble. 

    Best regards
    F
  • Hey Lloyd, thanks for the script.

    I hoped I can change filepaths for all elements inside the currently open project on-the-fly. Since I only need the altered file paths temporary

    Searching for the projects in the folder and saving out new ones, which again I have to open and then save, then convert back to the old filepaths again when I'm finished is really cumbersome.

    Would it be possible to implement this into the script, too? 
  • Hey Lloyd, thanks for the script.

    I hoped I can change filepaths for all elements inside the currently open project on-the-fly. Since I only need the altered file paths temporary

    Searching for the projects in the folder and saving out new ones, which again I have to open and then save, then convert back to the old filepaths again when I'm finished is really cumbersome.

    Would it be possible to implement this into the script, too? 

    that is not technically possible
  • Hello, I think this script is almost great....

    I am looking for the ability to replace a layered .psd file with raw .png assets

    I have gotten as far as getting it to replace everything but the darn / character 

    What I have:
    Page09A/PageWorking.psd
    What I want:
    Page09A.png

    What I have been getting. 

    Find:
    \PageWorking.psd
    Replace:
    .png

    but I get:
    Page09A/.png

    is there anyway to stop it from taking the /? If I stopped it from taking the slash I would be golden. I am a PC user. 

    Thanks


  • Hello, I think this script is almost great....

    I am looking for the ability to replace a layered .psd file with raw .png assets

    I have gotten as far as getting it to replace everything but the darn / character 

    What I have:
    Page09A/PageWorking.psd
    What I want:
    Page09A.png

    What I have been getting. 

    Find:
    \PageWorking.psd
    Replace:
    .png

    but I get:
    Page09A/.png

    is there anyway to stop it from taking the /? If I stopped it from taking the slash I would be golden. I am a PC user. 

    Thanks


    Please open a support ticket and provide screenshots of your UI as well as the log so we can help you further.
  • Dear Lloyd,

    I need to replace quite a bit of footage names and footage paths in AE:

    For example from "C:\1414\1414_diffuse.exr" to C:\1415\1415_diffuse.exr.

    according to a excel list with 60 product numbers and the accordingly named renderings.

    I am looking for something to automate the process in AE, but I am not sure if Batch Search n Replace or Immigration would be the better tool for this.

    Thank you for your time and best regards

    Chris


  • Dear Lloyd,

    I need to replace quite a bit of footage names and footage paths in AE:

    For example from "C:\1414\1414_diffuse.exr" to C:\1415\1415_diffuse.exr.

    according to a excel list with 60 product numbers and the accordingly named renderings.

    I am looking for something to automate the process in AE, but I am not sure if Batch Search n Replace or Immigration would be the better tool for this.

    Thank you for your time and best regards

    Chris



    Batch Search n Replace should be able to do this. But to do proper spreadsheet based versioning you should use Templater Pro: https://aescripts.com/templater-pro
  • Dear Lloyd,

    thank you for your advice, going as far as to recommend a product from a different company.

    Template Pro looks great, but it´s a bit over the top for what I am aiming at.

    I will test your plugin first on a handful of entries and see if it will get the job done

    Thank you very much and have a nice day

    Chris
  • Hi Loyd 

    When I do a search and replace it created a new project like it should, but 2 issues:

    1. when I open the updated project the names of the footages are changes but they are not linked. When I link the first file it find all the rest however. 
    AM I doing something wrong?

    2. Is there a way to have it open the updated project file automatically?
  • Hi Loyd 

    When I do a search and replace it created a new project like it should, but 2 issues:

    1. when I open the updated project the names of the footages are changes but they are not linked. When I link the first file it find all the rest however. 
    AM I doing something wrong?

    2. Is there a way to have it open the updated project file automatically?
    Unfortuantely the api does not allow for this. 
  • I know this script is quite old but..
    Does it have the ability to replace the extensions?  ie: from  ".mp3  to ".jpg

    I have mp3's and jpg's in separate folders with the exact naming conventions.

    As an example: from

    EV_001_HTG12.mp3
    EV_001_DDR22.mp3

    To

    EV_001_HTG12.jpg
    EV_001_DDR22.jpg

    Thanks
    Jeff
  • Jeff SP said:
    Does it have the ability to replace the extensions?  ie: from  ".mp3  to ".jpg

    yes
  • Thank you for the reply!

    Trying many variations without success.
    receiving this error:

    Search string: AUDIO
    Replace string: IMAGES
    1. Error: After Effects error: file ‘IMAGES’ cannot be imported — files of type “” cannot be used as sequences..


    Does it need to be a sequence?

    My  files,(.mp3, .jpg ) although they match exactly in naming convention, are not sequential.

    EV_001_HTG12.mp3
    EV_002_DDR22.mp3
    EV_003_TTHC2.mp3

    Also, it should be noted that I'm using an earlier version of your script.( if that makes a difference)

    Thanks
    Jeff
  • Jeff SP said:
    Thank you for the reply!

    Trying many variations without success.
    receiving this error:

    Search string: AUDIO
    Replace string: IMAGES
    1. Error: After Effects error: file ‘IMAGES’ cannot be imported — files of type “” cannot be used as sequences..


    Does it need to be a sequence?

    My  files,(.mp3, .jpg ) although they match exactly in naming convention, are not sequential.

    EV_001_HTG12.mp3
    EV_002_DDR22.mp3
    EV_003_TTHC2.mp3

    Also, it should be noted that I'm using an earlier version of your script.( if that makes a difference)

    Thanks
    Jeff

    you will need to watch the video tutorial on the product page and how to use the script. since it is altering the project file you have to be careful not to break things
  • Thanks Lloyd.

    The script demo shows how to replace folders, which is straightforward. I'm attempting to replace the extensions, which isn't indicated. When I replace .mp3  with .jpg ( whereby both mp3's and jpg files are in the same folder.)

    The log indicates as successful.
    Search string: .mp3
    Replace string: .jpg
    "1. Succesfully replaced:......*.jpg"

    But the project file is broken. The file names are truncated and all their paths are displayed as   "<Missing>"

    I'm using CS6 btw, if that makes a difference.

    Jeff
  • Jeff SP said:
    Search string: .mp3
    Replace string: .jpg
    "1. Succesfully replaced:......*.jpg"
    But the project file is broken. The file names are truncated and all their paths are displayed as   "<Missing>"

    Without seeing your project, on theory could be that After Effects might have a filetype flag somewhere and when the new file doesn't match it breaks the project.

    You can open the XML project file yourself in a text editor and see if you can replace it manually to see if that works.
  • Thanks..

    It seems enabling "Use XML project" was the problem"

    All mp3's are replaced with Jpeg images!

    ... unfortunately all their out points are set to 00001
    I was hoping the mp3 to jpg replacement would respect it's new JPEG Type, while retaining the length of each original mp3 file.
    (It works when I use the Replace Footage for each file manually)

    Either way.  moving on to finding another solution.
    Thanks again for the help.
    Jeff

  • Jeff SP said:
    Thanks..

    It seems enabling "Use XML project" was the problem"

    All mp3's are replaced with Jpeg images!

    ... unfortunately all their out points are set to 00001
    I was hoping the mp3 to jpg replacement would respect it's new JPEG Type, while retaining the length of each original mp3 file.
    (It works when I use the Replace Footage for each file manually)

    Either way.  moving on to finding another solution.
    Thanks again for the help.
    Jeff


    Have you tried using Immigration? https://aescripts.com/immigration
  • Tried using Immigration.
    It imports the jpgs.., but doesn't replace the original .mp3's
    Likely due to the mismatch in file type.

    Thanks again!
    Jeff
  • Jeff SP said:
    Tried using Immigration.
    It imports the jpgs.., but doesn't replace the original .mp3's
    Likely due to the mismatch in file type.

    Thanks again!
    Jeff
    Interstesing.. what about Pro IO? https://aescripts.com/pro-io

  • I'll check that out.
    Thanks!