Indesign Search and Replace Link Paths

Have you ever tried renaming your server or moving your Indesign files to a new place and have all the links go missing? Your image files may have had a file path like:

ClientServer:Jobs2017:Brochure:Images:

and the new files have been moved to your archive server like this:

ArchiveServer:Jobs2017:Brochure:Images:

The filing structure is the same except that the address starts with “ArchiveServer” instead of “ClientServer”. However Indesign has no idea where to look for those links. Wouldn’t it be great if you could simply update the file path of every image, changing “ClientServer” to “ArchiveServer”? Well guess what? There is now.

This AppleScript adds a new “Search and Replace” function to Indesign. It searches and replaces text elements within the file paths of your placed images.

Enter the search and replace terms to search and replace elements from the link file paths

Every matching link will be updated to the new place. Note that this will only work if the folder structure is indeed the same after the server/folder name change. This is typically the case if you have renamed your server or moved a whole lot of folders to a new place on a server.

If the script does not find certain files in the expected location, they will be skipped. Files whose file paths do not contain the search term will not be affected. The script is highly specific and will only target the file paths where the search term is found. And it works very quickly.

You can run the Indesign Search and Replace Link Paths script and replace any segment of the file path – it doesn’t have to be the first part (parent directory). It can be any folder name or file name within the file path, even parts of a name. It can also be multiple folders. For example, if your original location was:

Earnest:Users:dm1:Desktop:Brochure:Images:

and your new location is

Archive1:2017_Jobs:Brochure:Images:

Simply enter those two folder paths into the search and replace fields remembering to keep the colons (:) in between each segment name. Search for “Earnest:Users:dm1:Desktop” and replace it with “Archive1:2017_Jobs”.

Here’s how to use the script on file names. Imagine you have a whole lot of images with the suffix “_LowRes”. Then you make a whole set of new files with the suffix “_HighRes”. Use these two search and replace fields to update all images with “_LowRes” to the corresponding “_HighRes” file. In this case the files would all have to be in the same folder. If they are in a different folder, use the secondary search & replace (see details below).

Optional second search and replace fields

The script can now update files that have a different name and are also in a different folder.
For example your original files all end with “_LowRes” and are in the “Low Res Images” folder. The files you want to update to have the suffix “_HighRes” and are in the “High Res Images” folder. Use the new secondary search and replace feature to specify the change in folder location as well as the change in file name.

Example file paths:

Before:
MyServer:MasterImages:Low Res Images:Giraffe_LowRes.jpg

After:
MyServer:MasterImages:High Res Images:Giraffe_HighRes.tif

In the screenshot above, all the images placed from the Low Res Folder would be updated to the corresponding images in the High Res Folder.

The two search & replace options are not limited to folders and files – they can be used on any part of the entire file path including the colons which separate the folder names.

More options / tips

  • A new check box gives you the option to limit the search & replace to missing images only.
  • You can update files to their corresponding versions that have a different file extension. For example, change “.jpg” to “.tif”.
  • There is the option to process all open documents if you want to.
  • The script remembers the last search and replace terms you used so you don’t have to re specify them every time
  • If you’re working from home using OneDrive or DropBox, sometimes the file paths are named differently. In this case you may need to include your usernames in the search and replace.

A progress bar and conclusion message keep you informed of what is going on.

Note this is an AppleScript for using on a Mac. Latest version R9 has been tested with Sonoma 14.4.1 and Indesign 19.4. If you bought the previous version more than 18 months ago, please support drscripto by purchasing the latest version. 

Download this script for $14.99

Technical support replies within 24 hours. Suggestions and customisations welcome. 

What if your folder hierarchies are messed up?

If your links are in a disordered state and you don’t really know where they are apart from somewhere within a top level folder which may contain hundreds or thousands of subfolders, you might do better with the Indesign Image Relinker Script also available at Dr Scripto. This will actually search through every subfolder, find your lost images and relink them to Indesign.

paypal_secure_crop_70pc

24 Comments

  1. Hi

    This scripts seems to nearly be something I need.
    Because I am in the progress of archiving a lot of InDesign jobs.

    But what I need is for the script to only change the path of images which are missing.
    Because some of the links (logos and other stuff) is in a general folder, where the files are not archived.

    I can not see this functionality in the description or am I missing something.

    Kind regards Jimmy Hartington

    Reply
  2. Hello, Is this script still working with the current Version of the Creative Suite?

    Kind regards,

    Annja

    Reply
  3. Joachim RischApril 7, 2020 at 10:14 pm

    Hi drscripto. Does this script also work with files that are located on a currently not available server as long as I know the correct path to the “Links” folder on that sever?

    Reply
  4. Hi DrScripto, I’ve a question which I;m not sure if your script wil solve this.
    Situation:
    • We have hundreds of .indd files across several folders which include linked images/files.
    • 95% of the Images are mainly linked to one image folder (inc sub folders)
    • I want to change the folder path of where all files+links are located (change ‘host’ basically).

    Main Question
    Does your script ‘update’ all links for all the .indd files in folders & subfolders? Or does this script work only for a single file and change the path of the specifc links?

    If it’s only 1 file – is there a way my colleagues can ‘locate’ the new path of links easily when opening a move .indd file?
    Hopefully you understand my question.

    Reply
    • Hi Kasper,

      The Indesign Search & Replace Link Paths script can work on the Indesign document that is currently open, or it can process ALL the Indesign documents that are currently open. It can also attempt to update the link paths of all placed images, or only the ones that are currently missing (using the checkbox in the dialog box).

      It only updates the links found in the files that you are processing so if you open additional Indesign files after that, you will need to do the same process on them for their links to be updated. However, this script works quite fast and it remembers the settings that you choose in the dialog box in between runs.

      Reply
  5. I think this will work for what I need, but I wanted to make sure.
    I have a company that I work with that has a set of around 100 indds that pull their logo and disclaimers from:

    MasterLogos:Company1:Logos:CompanyNameLogo.eps
    MasterLogos:Company1:Images:Disclaimers:CompanyNameDisclaimer.tif

    They’ve recently added new branches with new logos and disclaimers. Each branch gets it’s own set of indds and folder structure for the links:

    MasterLogos:Branch1:Logos:Branch1Logo.eps
    MasterLogos:Branch1:Images:Disclaimers:Branch1Disclaimer.tif

    If I’m reading this right, I should be able to duplicate the original indd folder, rename it Branch1, open the new indds, and run this script to batch relink all the logos and disclaimers to the new ones, even though the paths and names are quite different?

    Reply
    • Hi Brandon,
      from what I understand, this is correct. The only change in the location of the disclaimers and the logos is that the “Company1” folder is changed to “Branch1”, so they are your search and replace values right there. If there is also a change in the filename of the logos and/or disclaimers you could also use the second search and replace field. For example, “CompanyNameLogo.eps” changes to “Branch1Logo.eps”.

      Reply
  6. Hi Brnadon, What I need is for a catalog created in Indesign. At some point in the process, I need to swap out the low res images for high res image in order to release the image files. The only difference in the name would be the extension, from a .jpg to a .psd. Will this script be able to accomidate that task? Thank you.

    Reply
    • Hi Kathleen, yes! If the .psd files are located in the same folder as the .jpg files then this script can swap them with one search and replace (“.jpg” to “.psd”).

      If the PSD files are located elsewhere, you would have to also use the secondary search and replace field of the script to change the other part of the file path. For example, replace “Images:LowRes:” with “Images:HighRes:”.

      That will re-link the JPEGs in the LowRes folder to the same named PSDs in the HighRes folder.

      Reply
  7. Hi DrScripto,
    I want to buy and use this on a PC running Indesign CS6. Our server path has changed and i need to relink hundreds of files (jpg, pdf, indd) in hundreds of indd documents. Please can you adapt this version to work with PC? Thanks and love your work! Koen.

    Reply
  8. I am one more buyer if a PC / Javascript version comes along 🙂

    Reply
  9. Is there a way to get a version where the updated path doesn’t have to be present to be successful? We have moved from a physical server to a cloud server the only downloads files when needed so the files aren’t always “available” when we run the script.

    Reply
  10. Hi drscripto,

    i recently started to use the optional second s&r item in this script, but encountered some unexpected behaviours. I’m trying to replace multiple linked items which have been moved to a new server. Some items are virtually in the same path, just on the new server, some items have a slightly changed path.

    So i tried the following settings:
    First s&r setting:
    oldserver:
    newserver:
    Optional second s&r setting:
    XX_Archive:Stuff:YY_OurTeam
    ZZ_Archive:OurTeamStuff

    This doesn’t work as i would have expected it. I need to run two searches to relink all items. Once only with the first s&r settings to relink items which are in the same path, just on the new server, a second time to relink items which are both on the new server and have a changed path.

    Running the script just once with both s&r settings enabled won’t relink items with the same path (on the new server). Am i doing something wrong or is this the intended behaviour?

    Reply
    • Hi Flo,

      great question! Actually the intention of the second s&r field is to have a second search and replace for each and every path. It’s not an optional extra search & replace. To give you an example, you might have moved files to a new folder but also you want to relink to JPEGs instead of TIFs:

      First S&R field
      Search for: “images:high-res:”
      Replace with: “images:low-res:”

      Second S&R field
      Search for: “.tif”
      Replace with: “.jpg”

      This will relink images from the “high-res” folder to the “low-res” folder replacing the “.tif” versions of the files with the “.jpg” versions of the files.

      Reply
      • So this is indeeed the intended behaviour, got it. We’ll just run the script twice then, no problem. It’s still a big timesaver.

        Thanks for the reply!

        Reply
  11. Is it possible to modify this script to replace 5 color files with 4 color. We have files that have PMS and CMYK in the name. We have to frequently replace them depending on where they are going to print.

    Reply
    • Yes absolutely. As long as the files are named differently in the same folder, or in another folder. For example, if your original file path was Desktop:images:cat_CMYK.jpg and your replacement image was in the same folder and called “cat_PMS.jpg”, you would get the script to do a search for “cat_CMYK” and replace with “cat_PMS”. Or if you had multiple files named like this you could search for “CMYK” and replace with “PMS”.

      If the files are located in a different folder, for example to replace this file – Desktop:images:CMYK:cat.jpg – with this file – Desktop:images:PMS:cat.jpg, get the script to search for “CMYK:cat” and replace with “PMS:cat”. If you want to update every image placed in your indesign file this way, search for “CMYK” and replace with “PMS”. In this example the two files are named the same but in different folders. One folder is called “CMYK” and the other is called “PMS”.

      If the files are in different folders and the files are also named differently, then use the second search and replace section of the script interface to also search and replace the filename (or parts of the filename).

      Reply
  12. I love it! This script saved my day and hours of work!

    Reply

Your email address will not be published.