is now part of CreativePro.com!

Swapping Text and Images with a Free Script

2

There are certain kinds of documents that have to be made super quickly and which require a lot of icons or inline graphics. And to be honest, InDesign does not make it easy to place dozens or hundreds of tiny little graphics quickly. So I want to show you a free script that can supercharge these kinds of layouts by swapping plain text for inline images.

In the following document, I have a bunch of text… and instead of inserting the images manually, I’ve just typed in key phrases or words that describe them:

original text

What I’d like to do is search through the whole document and look for these kinds of phrases and automatically swap them with an icon. To do this, I’ll use a script called Swimmer, written by Kris Coppieters at the development and automation company Rorohiko. He wrote this as a challenge at PePcon a few years ago.

(Kris loves giving his products funny names… so in this case “Swimmer” is short for Switch-Image-r. Groan!)

Swimmer

When I run the script (by double-clicking on it in the Scripts panel) it takes just a few seconds to find all those phrases and replace them with the icons. The images are all placed at 100% size as anchored or inline graphics, in the same place as the text.

after the script

Even more amazing: it works in reverse, too! Just double-click the script again and all the graphics are replaced by the original text.

How does it work? It uses a text file, called SwimmerConfig.ini:

swimmer config

This looks kind of scary at first, but it’s pretty simple, actually: You can see that there are clear groupings of “text” and “imageName”. The ReadMe help file that Kris wrote makes it very easy to set up—it takes just 10 or 15 minutes for you to set up these relationships between the text it’s looking for and the names of the graphics. You can even use GREP if you want to, but if you don’t know GREP, you can just copy and paste text.

You can find Swimmer on Kris’s web site here.

David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, CreativePro Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at LinkedIn Learning (Lynda.com) are among the most watched InDesign training in the world.
You can find more about David at 63p.com

Follow on LinkedIn here
  • Nice. It’s similar to this script that was originally authored by Peter Kahrel and then modified by Kasyan Servetsky: https://www.kasyan.ho.com.ua/indesign/image/place_inline_images.html

  • William Greenwood says:

    This looks a great script. Worth a download and a play with this.

    I regularly place inline graphics for many brochures.

    My usual plan is just to create a custom font with the graphics in place. Then as regular text characters they can be changed and styled with find and replace.

    Cheers
    Bill

  • >
    Notice: We use cookies on our websites to give you a great online experience. If you keep browsing, we'll assume you're ok with this. For more information, see our privacy policy. By closing this banner, you agree to the use of cookies.I AGREENo