Reply To: Macro/Script for multiple text find-change queries?

Home Page / Forums / General InDesign Topics (CLOSED) / Macro/Script for multiple text find-change queries? / Reply To: Macro/Script for multiple text find-change queries?

#54959

“January 123:321″ would be changed to “Januar 123:321″, but “January” alone would not be.

That's a good candidate for search-and-replace with GREP.

Try this, with plain InDesign, using the GREP Search and Replace dialog. Search for

<January(?= ddd:ddd)

and replace with

Januar

(Mind not to forget the space immediately following the equals.) If you press the “Find next” button, you will see it miraculously skips all Januaries that stand on their own …

The (?= ..) stuff is called a lookahead. It means “January” will only be found when it is followed by a space, three digits, a colon, and then three more digits. However, this suffix will not be “marked” by the Find function — only the plain text “January” will be selected! And only this selected part will be replaced with whatever you put into the “Replace” field.

You can put this straight into the FindChangeBy script data file for every month to replace (or, better, use the Record script because the syntax of that data file can be a bit daunting).

This article was last modified on February 22, 2010

Comments (0)

Loading comments...