What is Swimmer?
Swimmer (SWitch IMmagER) is a script for Adobe InDesign.
In a catalog or brochure you might need little icons for ‘microwave safe’ , ‘food safe’,or ‘hand wash’… or such like.
Instead of painstakingly creating inline images, you can just use some code word or key word of your choosing and then replace all those words in one fell swoop.
Swimmer will search your InDesign document, looking for specific key words or key phrases and replace these with small inline images or icons.
Running Swimmer again reverts the document back from images to key words.
Installing Swimmer
- Download PluginInstaller.
If you’ve not done this before, download and install the free PluginInstaller from PluginInstaller.com.
Make sure you have build #558 or higher installed (the build number is shown in the lower right-hand corner of the PluginInstaller windows). - Create an Account.
If this is your first time using PluginInstaller, you’ll need to create a new account and register it within PluginInstaller.
Make sure to click the confirmation link in the registration email! - Add a Swimmer Bookmark.
Add a bookmark for Swimmer into PluginInstaller by clicking the following link:
Add Swimmer Bookmark into PluginInstaller
Alternatively, you can use the Browse the Store for Software window in PluginInstaller and find the Swimmer bookmark in the Rorohiko Catalog. - Download and Install.
Once the bookmark is listed in the Installing and Ordering window, select it and click the Download button.
After the download, choose your InDesign version from the Install Target dropdown menu and click the Install button. Swimmer will appear in the InDesign Scripts panel under the User section.
Demo Version/Purchasing
Swimmer comes as a demo script: you can run it 10 times per 24 hours; after that, you need to wait until the next day before you get another 10 script runs out of it.
If you want to upgrade to a full version, you need to purchase an activation: an activation costs you US$ 9.00 per seat and it will last for a year.
Go to the Installing and Ordering window, select the Swimmer bookmark, and click Purchase.
Activation may take some time to process; keep an eye on the Licenses, Activations, and Pending Orders window for updates.
Configuration
You define the behavior of the script by modifying the configuration data in the text frame on the pasteboard.
INI configuration frame
The format is pretty self-explanatory; skip ahead to ‘Description of the Options’ if you ‘grok’ things already.
Here is the detailed TL;DR information for the formatting rules:
The text frame is formatted in a format similar to the old-style Windows INI format, with some additional flexibility built-in.
The advantages of this approach is that each document can ‘carry’ its own configuration and the configuration is plain for everyone to see, in a human-readable form, rather than being hidden away on some preferences dialog.
- The information is spread over multiple paragraphs or lines.
- There are two types of relevant lines:
[SECTION]
orname=value
. Any lines that do not consist of either a name in square brackets or a name, an equal sign and a value are ignored. - The information within the square brackets (the
SECTION
) or information to the left of the equal signs should not be edited (thename
). - The
name
to the left of the=
are case-insensitive and only lettersa-z
and digits0-9
are taken into account. Names likeabc
,a B c
, orA'b'c
are all interpreted as the same thing –abc
- The information to the right of the equal signs can be freely edited
- By default, leading and trailing spaces are ignored.
someData =some Value someData= some Value someData = some Value
are all equivalent – they all mean
someData="some Value"
- Quotes can be used to express leading or trailing spaces. Curly quotes are seen as equivalent to regular quotes.
someData = " some Value " someData= “ some Value ”
both indicate that
someData=" some Value "
including the leading and trailing spaces. - Numeric values can have units and the script will auto-convert between units as needed. If the horizontal unit is
cm
and the label frame width is written as1 inch
, the width will automatically be interpreted as2.54 cm
Description of the options
The configuration frame contains a single [config]
section followed by one or more [replace]
sections. Each [replace]
section represents a single keyword or key phrase and its associated image file.
base folder
Appears in section [config]
. This tells the script where to find the images. This is either a path relative to the document’s folder, or an absolute path to a location somewhere else.
The sample document SwimmerSample.indd that comes with Swimmer is accompanied by a folder SwimmerSampleImages which contains the sample images. That folder needs to remain ‘beside’ the document for the sample demo to work.
text
Must appear in every [replace]
section. This is a GREP expression (JavaScript GREP, not InDesign GREP). \b means ‘word boundary’, so \bword\b will match ‘word’ but won’t match ‘password’.
image name
Must appear in every [replace]
section. This is a file name of an image file located in the base folder
case sensitive
Optional. Can appear in the [replace]
section. Setting this to 1
makes the text
pattern be case sensitive.
object style
Optional. Can appear in the [replace]
section. This is the name of an InDesign Object Style that needs to be applied to this image when it is inserted into the text.
If this is omitted, an object style SwimmerObjectStyle will be applied by the script. You can use this object style to tweak the positioning by modifying the anchored object settings of the style.
Version history
Version 2.0.0: June 26, 2024
– Updated script to work with CRDT_ES and PluginInstaller.