• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
6

Automatically use first letter in page header?

Engaged ,
Mar 20, 2024 Mar 20, 2024

Copy link to clipboard

Copied

For a people directory, I'm transitioning from using someone else's system to using my own database and InDesign. If possible I'd like to keep the appearance similar to how it was, and one aspect was that the top of each page displayed the first letter of the names on that page. See this example of the last page of O and first page of P from last year's directory:

Screenshot 2024-03-21 135114.png

Is there a way I can populate that header letter automatically or semi-automatically? I know I can create 26 parent pages and manually apply each of those parent pages to the corresponding set of pages (and change those parent page assignments later if edits causes the flow to change). But it would be nice to make that more efficient and less error-prone. The letter I need will always be the first letter of the flowed content on the page, and if necessary, I can also delineate the first letter of all the names with a character style to help InDesign identify it. But I don't know how to get InDesign to either copy the contents of that first letter to a placeholder in the header or automatically apply a parent page based on it. I'm not afraid of scripting, although I'm new to scripting in InDesign.

TOPICS
How to , Scripting

Views

238

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Mar 20, 2024 Mar 20, 2024

Oh wow! I think I just found the answer. Instead of removing my question, I'll leave it here in case others need it. The answer is called "Text Variables", found on the Type menu. You can define a text variable of type "Running Header (Character Style)", select the style you want to pick up, choose "First on page" or "Last on page", and even include text before and/or after and even control punctuation and case. Once defined, then you put the cursor where you want it to show up (in my case, the

...

Votes

Translate

Translate
Engaged ,
Mar 20, 2024 Mar 20, 2024

Copy link to clipboard

Copied

Oh wow! I think I just found the answer. Instead of removing my question, I'll leave it here in case others need it. The answer is called "Text Variables", found on the Type menu. You can define a text variable of type "Running Header (Character Style)", select the style you want to pick up, choose "First on page" or "Last on page", and even include text before and/or after and even control punctuation and case. Once defined, then you put the cursor where you want it to show up (in my case, the header of a parent page) and select Type -> Text Variables -> Insert Variable, and choose the one you want. It works like a charm!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 20, 2024 Mar 20, 2024

Copy link to clipboard

Copied

Very cool! Well done. So you can get just a single letter of a word? - Mark

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 20, 2024 Mar 20, 2024

Copy link to clipboard

Copied

As long as the character style is only applied to that one letter, that's what you'll get. I'm importing text that I'm exporting from a database, and I'm using distinctive text indicators in that text that I will globally replace with styles in InDesign, so I'll just add another pair of indicators surrounding the first letter of every name (e.g. "##IN##S##OUT##mith"), which will get converted to a character style. The style doesn't have to look any different from the surrounding text - it just has to be there.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 20, 2024 Mar 20, 2024

Copy link to clipboard

Copied

LATEST

I get it! Excellent. Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines