hack : power find/replace text

this tip is borne out of frustration at seeing humans do things the hard way when there’s a perfectly simple, less insane way.

i need to convert text from a brief which looks like this :

into an applescript list that looks like this :

screengrab showing applescript list

transforming the text manually is about as inefficient as things get. this is an ideal job for find/replace. it just takes a few seconds to figure out the best way to attack it.

the trick is to remember that find/replace isn’t only for letters, words and spaces. it can also be used on invisible characters like tabs and line breaks.

this particular task can be achieved with just two find/replace passes – then a little cleanup.

any text editor will do, but for this kind of thing i always use BBEdit
(note : this is NOT a paid endorsement – i just love the app)

when i copy the text from word to BBEdit it looks like this :

the first pass changes the text between the numbers :

the second pass changes basically everything else :

(notice how BBEdit specifies the line break as ‘/n’ and the tab as ‘/t’)

then i just need to manually clean up the top and tail :

and we’re done.

keep grunting.

InDesign tip : #18

InDesign tip : #14 talked about different ways of zooming about an InDesign document. but it missed one really cool little trick which has, apparently, been with us since CS4 — when the navigator panel was dropped — and it’s called, impressively, power zoom.

you start with the hand tool. as always, you do not have to select the hand tool from the tool panel — you activate it temporarily in one of three ways :
• if you have one of the selection tools active — hold down the space bar;
• if the text tool is active but no text frame is selected — use option-space;
• if the text tool is active in a text frame — use option only.
why the developers insisted on making it this complicated is a mystery.

anyway, once you have the hand tool up, click and hold the mouse button. after a couple of seconds the screen will zoom out a little and present you with a red outline (and you can let go of whichever keys you’re holding down). drag the red outline to wherever you want in the document — scroll up or down (or use your arrows) to resize the red outline — let the mouse button go and you’ll zoom into the new outlined area. now THAT’S cool :
screen grab of view before power zoom
screen grab of view during power zoom
screen grab of view after power zoom

incidentally, if you like that groovy little image by dek wid, you can find a tutorial showing how it’s done over at photoshop tutorials.

macgrunt icon

InDesign tip : #17

lovers of typography love a well designed ligature. those who are indifferent to typography generally say “what’s a ligature?”. and those who are entirely ignorant don’t even notice a ligature even when they are looking straight at one. although, that’s actually the point of the ligature in the first place — you’re not supposed to notice the typographic trick, because the ligature is intended to make reading easier.

just to make clear the foregoing blather — here are some standard ligatures in well-known fonts. you’ll notice that not all fonts have been designed with a full complement of ligatures :
screen grab of a selection of ligatures in various fonts

that’s right, ligatures are those little joined-together thingies that are generated by default in InDesign. unfortunately, ligatures do not always lead to improved readability and sometimes you’re better off just using the standard letterforms.

you can turn ligatures off in the dropdown menu in the character panel. if you’re doing the right thing and using styles for your text formatting, you’ll find ligatures as one of the options under basic character formats. you can set no-ligatures as your default for all future documents by unchecking it in the character panel when you have no documents open.

the only way to turn ligatures off for an entire document in one hit is with a script something like this one :

tell application "Adobe InDesign CS4"
  tell active document
    tell every story
      set ligatures to false
    end tell
  end tell
end tell

of course, the Adobe CS being what it is, you do NOT turn ligatures off in Illustrator the same way you do in InDesign. for Illustrator you have to go to the opentype panel instead.

macgrunt icon

InDesign tip : #16

there appears to be no shortage of ingenious ways that InDesign users can make life difficult for themselves. here’s a cracker…

sometimes you need to indent a paragraph to accommodate a graphic, or a drop cap, or whatever. like this :
screen grab showing indented paragraph

this is the way NOT to do it. not only is it time consuming to set up — it’s a pain in the bollocks if you need to edit the text later :
screen grab of wrong way to align a paragraph

here’s one correct way to do it — set the left indent to the same as the tab and set the first line indent to its equivalent negative :
screen grab of paragraph aligned using correct text indents
screen grab showing the indets in the control panel

the only drawback of that method is that if you decide to change the tab later on, you also have to remember to change the two indents to match.

the other method is the best of all worlds — easy to set up and easy to edit :
screen grab showing the use of the 'indent to here' character

the indent to here character looks a bit like a sword (or a cross, if you prefer). place the character in the position where you want your paragraph to align to by using command-\. now if you decide to change the tab, the rest of the paragraph moves automatically.

if you think placing a whole bunch of those little doovies in a whole bunch of paragraphs is too time-consuming, then you really should revisit tip #15.

try it — you’ll like it.

macgrunt icon

InDesign tip : #15

working with text in InDesign doesn’t have to be difficult. here are just a few text selection tricks.

1x click = place cursor
2x click = select word
3x click = select line
4x click = select paragraph
5x click = select entire story
…but you probably already knew that.

to select a specific portion of text — click once at the beginning of the bit you want to select (to place your cursor) and then shift-click at the end — everything in between gets selected.

you can also navigate around and select text entirely with your keyboard.
left and right arrows take you along a line one character at a time — but hold down the command key and you’ll jump by words.
similarly, the up and down arrows move between lines of text — add the command key and you’ll jump to the beginning of the next paragraph.

here are some other tricks with the arrow keys
shift-left selects the next character
shift-command-left selects the next word
shift-down selects the next line
shift-command-down selects to the end of the paragraph
…these also work with the up and right arrows

combine all that with keyboard shortcuts for your paragraph and character styles and you’ll be a text formatting wiz.

macgrunt icon