Skip to main content
Biggossa
Participating Frequently
September 20, 2022
Answered

Copy a word with a Paragraph style into another field in the same page

  • September 20, 2022
  • 2 replies
  • 461 views

Hi There, I'm completely new in the scripting world in indesign but I think I need one to make faster some steps in my job. I have a page of a book, for exemple, containing Titles with a specific paragraph style. Titles are numbers. I need a text field in the top of the page that contains (in authomatic) the first Title, a minus sign and then the last Title present in the page (but with another style). It is possible to do it with a script?

 

Exemple: This is my page

104 (Title)

bla blabla blabla blabla bla (text)

105 (Title)

bla blabla blabla blabla bla (text)

106 (Title)

bla blabla blabla blabla bla (text)

 

In my Textfield I need 104-106

 

It is possible? How can I do That?

PS. (more difficult) If the page don't start with a "Title" I need the previous "Title" in my field...

 

Exemple: This is my page:

 

bla blabla blabla blabla bla

bla blabla blabla blabla bla (text)

105 (Title)

bla blabla blabla blabla bla (text)

106 (Title)

bla blabla blabla blabla bla (text)

 

In my Textfield I need 104-106

 

Thanks a lot for the help.

Paolo

This topic has been closed for replies.
Correct answer Willi Adelberger

Why you need scripting here? Work with paragraph styles and text variables or extend to cross references.

2 replies

Inspiring
September 21, 2022

Hi

In text menu > Text variables. Create a new one (name it eg. T1) based on Paragraphp style eg. Title and chech option First on page, then create next variable based on the the same Paragraph style and chech option Last on page (name it eg. T2). Next on master pages add a text frame and insert text variable T1 + anything U want + T2. Thats all

Biggossa
BiggossaAuthor
Participating Frequently
September 21, 2022

Hi, Mateusz, my infinite thanks! I never explored variables... but from now I'll do! Thanks again!

Willi Adelberger
Community Expert
Willi AdelbergerCommunity ExpertCorrect answer
Community Expert
September 20, 2022

Why you need scripting here? Work with paragraph styles and text variables or extend to cross references.

Biggossa
BiggossaAuthor
Participating Frequently
September 21, 2022

Hi Willi, thanks for the answer. I never worked with text variables, so sounds new for me. If you have a suggestion to a better way, thanks to show me it with a sample. When I can find an explanation or a guide to solve my problem? I did'nt found a solution. Thanks

 

Willi Adelberger
Community Expert
Community Expert
September 21, 2022

To use text based text variables you need to work with paragraph and caracter styles. You should explore them. There are a lot more variables.

 

Other posibilities are:

  • Linked content with the content tools.
  • Content exported as InCopy Story placed multiple times, (You do not need to use InCopy to use that.)