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
Why you need scripting here? Work with paragraph styles and text variables or extend to cross references.
Copy link to clipboard
Copied
Why you need scripting here? Work with paragraph styles and text variables or extend to cross references.
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
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:
Copy link to clipboard
Copied
Thanks a lot. I'll explore your paths. Thanks
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
Copy link to clipboard
Copied
Hi, Mateusz, my infinite thanks! I never explored variables... but from now I'll do! Thanks again!