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

Page master convert Text Variables script

Explorer ,
Mar 11, 2024 Mar 11, 2024

Copy link to clipboard

Copied

Hi, I have text variables in the header of a document. The header shows 3 variables: the chapter name + the starting chapter number + " - " + ending chapter number. 
For example: Recipes 1-2. 
BUT sometimes the header shows the same chapter number, for example: Recipes 5 - 5. Because there is only one.
My question is how can I replace "5 - 5" to "5" or "8 - 8" to "8" if they are non-editable text variables? 
I know there is a indesign function and other scripts to convert variables into editable text 
BUT.... being on a master page I think it is not that simple.
Any ideas? I have tried exporting in PDF, editing and finding/replacing text in Adobe Acrobat But you have to do it one by one and the even-numbered pages leave the text justified on the left instead of on the right.

 

TOPICS
Scripting

Views

119

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 11, 2024 Mar 11, 2024

Copy link to clipboard

Copied

You'll have to go through the text page by page, then on a page with a range with the same numbers (e.g. 5-5), override the frame on to the page (Shift+Ctrl+Click or its Mac equivalent) and change the text. (This could be scripted in principle but it's very messy.)

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
Explorer ,
Mar 11, 2024 Mar 11, 2024

Copy link to clipboard

Copied

Thank you very much Peter! It is a good idea. 
By selecting all pages I have been able to unlink all headers outside of the master page.
Now I would have to convert the variables of those frames into editable text.

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 11, 2024 Mar 11, 2024

Copy link to clipboard

Copied

Can you use Character Styles instead - and for the variables for the Running Heads can you select the Character style instead

 

That way - you can apply style 1 to 5 and style 2 to - 5 

And running head char style 1 will show 5

and running head char style 2 will show - 5

 

Any page that does not have - <number> will not show

 

I guess I need a visual on what you are doing 

It might just need another Parent Page applied to pages after the main chapter that has different variable data to capture/show.

 

 

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
Explorer ,
Mar 11, 2024 Mar 11, 2024

Copy link to clipboard

Copied

 
Thanks Eugene. Sorry... but I don't understand the procedure you explained. 
All chapter numbers have the same character style so that header variables can recognize them. Effectively I can create another master page with only END chapter (or Initial chapter)
for those pages that contain a single chapter. But I'm trying to find another solution,
it's 1000 pages, and there must be something more automatic.

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 11, 2024 Mar 11, 2024

Copy link to clipboard

Copied

LATEST

Yeh I can't think of a good way around this - the only option I see is different parent pages - but logistically that would be a nightmare to manage. 

 

The only option I could find was to use 

Running Header - First on Page

Running Header - Last on Page

 

But hard a weird result - as 1-2 were on my first page

but the variable returned 1-3 

3 and 4 were on the same page

but the variable showed 3-5

 

It did work the first time I set it up 

so page headers did read 3-4 for the spread. 

 

But somehow it completely broke and I couldn't get it back. 

 

There's a paid for option that might do what you want - I'm not 100% sure but  you could contact them and find out more

http://in-tools.com/products/plugins/power-headers/

 

 

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