Skip to main content
Taruz
Participant
February 9, 2015
Question

Color letters in specific order via scripting? - Is it possible?

  • February 9, 2015
  • 3 replies
  • 2791 views

Hello everyone,

This is something I've done manually. The thing is, I'm going to do it with a quite long text and it would take an insane amount of time

doing it manually. How would I go about if I wanted to script this? Or is there an other way of doing this?

Help of any kind is greatly appreciated.

Thanks

This topic has been closed for replies.

3 replies

Legend
February 11, 2015

Taruz,

after your thread has deviated a bit, here something more on topic: Are you aware there are also ways to colorize text by means of transparency effects, without any scripting? Actually you can apply an arbitrary texture by combining the text frame with a picture that in your case could be just a rainbow... This works without turning the text into paths. Unfortunately I can't provide links, I only saw it mentioned on twitter. If you're interested it may help to repost these details in the regular forum.

Marc Autret
Legend
February 9, 2015

Hi Taruz,

This can be done using either nested styles or GREP styles.

Nested styles:

1) Highlight Drop Caps and Nested Styles in your paragraph style settings window.

2) Create a new nested style using the rule "Style1 through 1 character", where Style1 is a character style that loads the first color.

3) Do the same with Style2, Style3, etc.

4) Then, add a [Repeat] nested style over the last N styles, where N is the number of previously defined character styles (that is, the number of colors).

GREP styles:

Indiscripts :: Cyclic GREP Styles

@+

Marc

Community Expert
February 9, 2015

@Marc – I tested the GREP version (thank you for the patterns in your blog post) with 6 GREP Styles in one paragraph style.

Note: It's possible to spoil the pattern a bit, if the feature "Ligatures" is turned ON. (It is by default.)

See here:

Now the question is: Should the pattern start anew in every paragraph?
What to do, if we have table cells and the pattern should go on? Footnotes?

Then we need a more sophisticated approach by scripting this.

Uwe

Marc Autret
Legend
February 10, 2015

@Uwe

This ligature issue is very enlightening, thanks! I never realized before that one cannot 'colorize' a character individually if that character belongs to a ligature. Yet it makes sense, since color is necessarily a glyph-level attribute.

Interestingly, you can note that the character 'h' (in the 'Th' ligature of your figure) has in fact the orange color applied, but this color is overridden by the red applied to the character 'T'. So, in a ligature, the first character wins.

@+

Marc

Peter Spier
Community Expert
Community Expert
February 9, 2015

Moved to scripting...