InDesign Secrets Video: Deleting Tabs at the Beginning of Paragraphs and Applying a Paragraph Style
With all due respect to Tom Hanks and his nifty Hanx Writer app for iPad, people who use computers as typewriters just cause headaches for those of us responsible for laying out pages in InDesign, because, well, you never know what you’re gonna get from them.
And in the latest InDesign Secrets video at lynda.com, David Blatner shares a nifty GREP code for cleaning up a common problem with manuscript produced by folks who use a computer like a typewriter—tabs at the start of a paragraph. David also points out a little quirk in the way Find/Change works in InDesign, and why it makes a GREP search the best approach for removing the tabs and applying proper paragraph styling at the same time.
Check it out in the InDesign Secrets video series at lynda.com, which really is like a box of chocolates.
Sweet!
Thanks for this…I’m just now starting to construct GREP queries, examples really help!
Thanks. This will go into my proud collection of document clean-up GREPs. They save a lot of time.
If I copied the explanation in the video down right, the procedure is to go to Find—GREP and enter:
In the Find field: ^\t(.)
In the Replace field: $1
And if the document isn’t already styled, put Body paragraph in the Change Format box:
In my case, I wouldn’t need the last step because, if the original doesn’t have styles, I bring them all in as Body. Just make the first paragraph in a Place a Body style and the rest will repeat that.
I also usually replace all Times New Roman fonts with the documents default font. Word likes Times NR rather inordinately.
Anyone know how to have it S&R another problem, leading spaces in paragraphs? I tried replacing that ^\t, but that found all spaces not just those at the start of paragraphs. When I tried ^ followed by a space, it did seem to work, but I’m not enough of a GREP guru to know if there’s a hidden gotcha.
–Mike Perry
That’s why I have Word macros. They strip out all those tabs and spaces, converts the italic, bold, small caps, superiors, etc., to the proper coding. Then I save as a .txt file and import that way.
The timing of this couldn’t have been any better, I currently have a plethora of changes like this to make! A similar GREP would be to change any manually bulleted lines to take in the bulleted style while removing the manually placed bullet and tab. The key being to change the find field to this:
^~8\t(.)
In answer to Michael W. Perry’s question, try this code in the find field:
^\h{1,}(.)
(see https://creativepro.com/selecting-horizontal-vertical-spaces-grep.php for more info)
Cool. My writers can’t even restrain themselves to just one tab, so I search for multiple tabs, too:
^\t*(.)