Lesson C: Text Variables

Text Variables are a third way to grab content being used by styles. Other text can be generated, too, like dates and document names.

Discover more intricacies in the Compendium by reading “Text Variables” (page 325).

  • In the downloaded document called 7 Long Documents.indd, go to pages 6 and 7 and fit that spread in the window (-option-0/Ctrl-Alt-0).
  • Insert the text cursor just below the last line of text on page 6.
  • Choose Type > Text Variables > Define….
  • Click the New… button. You should see this dialog box. Configure it like this:
  • Click OK, then in the first dialog box we saw, click the Insert button followed by the Done button.
  • Notice that the variable draws content from the blue text in the beige frame, which uses the Lesson or Topic title style, but is itself formatted like the text around it. Test this idea…
  • Go to page 4 and insert the cursor at the bottom of the frame there.
  • Choose Type > Text Variables > Insert Variable > current topic (or whatever name you chose to give it). It again adapts to the style applied to the paragraph where it was inserted.
  • Go back to pages 6 and 7. Choose Type > Text Variables > Define… then double-click on Modification Date in the list of variables.

You’ll see code used to assemble a date and time. The small arrow to the right of the Date Format field is where you access those bits. You may also type what you like in that field. I added the comma, spaces, and colons, for example.

  • Remove “h:mm aa” from the Date Format field. Insert the cursor where it was, then use the small arrow to the right choosing Year > Era.

Someone at Adobe had a sense of humor: there aren’t that many InDesign documents modified more than two thousand years ago.

  • To shorten the year to two digits, replace “yyyy” with “yy.” Experiment!
  • Click OK if you like your experiments, or Cancel if you don’t. Then click the Done button.

Update Display Bug

There’s a bug. At the moment, a text variable in the larger frame is telling us what’s written in the frame at the top of the page.

  • Change the text in the frame at the top of page 6. The variable doesn’t appear to change, but it has!
  • Either zoom in and out or go to another page and return. The “redraw” of page 6 visually updates the variable. If the text and the variable had been in the same frame, the change would have been instantaneous.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset