A Little Greplet


Just a quick example to whet your grepetite.

I was looking at some XML code in InDesign today and wishing I could emulate Dreamweaver, Oxygen, etc, where you can pick highlighting colors for code, to make it a lot easier to read. The code was actually an example spelled out on the document page, not real live XML in the structure pane.

Even a small piece of code can be pretty taxing on my little brain when it looks like this.

I look at that and think, “when’s lunch?”

Then I think, “what’s a quick way to make the tags bold and something other than black?” I think you could get some fancy results with nested styles, but a) that was more work than I wanted to do, and b) I didn’t want to add any styles to the document.

Voila, a greplet is born.

What this dialog is saying to InDesign is, “find all my opening and closing tags and make them bold and blue.”

Literally, find “<” followed by one or more word characters “\w+” followed by “>” or “|” “</” followed by one or more word characters “\w+” followed by “>”

Hit Change All and we get this:

It still ain’t the Mona Lisa, but at least I’m not eating my lunch at 10 AM just to get away from it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: