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

Community Beginner ,
Sep 20, 2022 Sep 20, 2022

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

65

Likes

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

Community Expert , Sep 20, 2022 Sep 20, 2022

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

Likes

Translate

Translate
Community Expert ,
Sep 20, 2022 Sep 20, 2022

Copy link to clipboard

Copied

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

Likes

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 Beginner ,
Sep 20, 2022 Sep 20, 2022

Copy link to clipboard

Copied

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

 

Likes

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 ,
Sep 21, 2022 Sep 21, 2022

Copy link to clipboard

Copied

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.)

Likes

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 Beginner ,
Sep 21, 2022 Sep 21, 2022

Copy link to clipboard

Copied

LATEST

Thanks a lot. I'll explore your paths. Thanks

Likes

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 ,
Sep 21, 2022 Sep 21, 2022

Copy link to clipboard

Copied

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

Likes

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 Beginner ,
Sep 21, 2022 Sep 21, 2022

Copy link to clipboard

Copied

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

Likes

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