Highlighted

Partial title text Variable - script

Community Beginner ,
Apr 20, 2020

Copy link to clipboard

Copied

Hi! I'm fairly new to InDesign and scripting. Is there a script to just show a part of a text variable? I found something similar but coulnd't get it to work for my cause.

 

I have a project with articles with different titles, that will be shown in the top corner of the pages. I have done this with InDesign's variables. The problem is that some of the titles are so long that they won't fit. Is there a somewhat easy way to define this variable to only include a certain amount of characters? 

 

Thank you!

Correct answer by Caroline96 | Community Beginner

Actually I just came up with an even easier solution by myself!

 

I have the full titles as they are, but create a new Character Style. With this I select only part of the long titles. Then I can just create a new variable as Running Header, based on the Character Style. This way you don't even need extra titles and it's very ease to choose just how much of the title you want to show in the header 🙂

TOPICS
How to, Scripting

Views

325

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

Partial title text Variable - script

Community Beginner ,
Apr 20, 2020

Copy link to clipboard

Copied

Hi! I'm fairly new to InDesign and scripting. Is there a script to just show a part of a text variable? I found something similar but coulnd't get it to work for my cause.

 

I have a project with articles with different titles, that will be shown in the top corner of the pages. I have done this with InDesign's variables. The problem is that some of the titles are so long that they won't fit. Is there a somewhat easy way to define this variable to only include a certain amount of characters? 

 

Thank you!

Correct answer by Caroline96 | Community Beginner

Actually I just came up with an even easier solution by myself!

 

I have the full titles as they are, but create a new Character Style. With this I select only part of the long titles. Then I can just create a new variable as Running Header, based on the Character Style. This way you don't even need extra titles and it's very ease to choose just how much of the title you want to show in the header 🙂

TOPICS
How to, Scripting

Views

326

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
Apr 20, 2020 0
Most Valuable Participant ,
Apr 20, 2020

Copy link to clipboard

Copied

I usually solve this by creating a separate paragraph style for the running headers. Copy the actual titles and apply this style (it should be the one that your variable picks up as well), then set the paragraph style text color to [None] so it won't show up. If you need to edit one, just temporarily set its color to something visible again.*

 

*I generally use Sickly Glowing Green for this so when I accidentally forgot to switch it off on exporting a file, I can immediately spot it when viewing the PDF before sending. If I forget that as well, the client usually informs me "something appears to be wrong".

 

Ah -- and another useful tip. Set the font and size to the same values aas your actual running header. That way you can immediately eyeball if it will fit or if it's too long.

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
Reply
Loading...
Apr 20, 2020 0
Community Beginner ,
Apr 20, 2020

Copy link to clipboard

Copied

Thank you for the fast answer! That sounds like a really good (and easy!) way to do it, I didn't even think about the possibility to do 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
Reply
Loading...
Apr 20, 2020 0
Community Beginner ,
Apr 20, 2020

Copy link to clipboard

Copied

Actually I just came up with an even easier solution by myself!

 

I have the full titles as they are, but create a new Character Style. With this I select only part of the long titles. Then I can just create a new variable as Running Header, based on the Character Style. This way you don't even need extra titles and it's very ease to choose just how much of the title you want to show in the header 🙂

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
Reply
Loading...
Apr 20, 2020 0
Most Valuable Participant ,
Apr 21, 2020

Copy link to clipboard

Copied

Very good! Yes, that'll work just fine when your shortened title is the first part of your original title. (I marked your own solution as "Correct answer" because it may work this way for others as well.)

 

You can even combine this with my solution if the wording needs a change after all: type the new title, apply your own character style, then set the color to [None].

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
Reply
Loading...
Apr 21, 2020 0