Skip to main content
Known Participant
October 29, 2022
Answered

XML import and automatic color change

  • October 29, 2022
  • 1 reply
  • 548 views

Hi there,
I need to integrate notes during an XML import on indesign. These notes have colors, for example from 1 to 1.9 is green, from 2 to 2.9 is yellow.
Is it possible to apply a precise color according to the note automatically imported in xml?
Thanks for your help.

This topic has been closed for replies.
Correct answer Laubender

Hi @Mouchet0D4C ,

you need one GREP style for the "/10" and several for all color instances.

How many different ranges do you have? Nine ones for 1 to 9 ?

What do you mean by "I'm stuck setting up all the different styles automatically"?

Finding a GREP pattern that matches one single color range?

 

Download my sample InDesign document from my Dropbox account with instances for 1 and 2.

The GREP patterns I used are very simple ones that do work only for a range from 1 to 9 at the beginning of the expression. This one, and higher, is not supported: 10,0/10 to 10,9/10.

 

221029-1-GREP-Styles-Sample-2022.indd

https://www.dropbox.com/s/k9lfovofd57c1v9/221029-1-GREP-Styles-Sample-2022.indd?dl=1

 

Pattern for the smaller part, that is working with a "Positive Look Behind":

 

(?<=\d,\d)/10

 

 

Sample pattern for the first range from 1.0 to 1.9 :

 

1,\d/10

 

 

Regards,
Uwe Laubender
( Adobe Community Expert )

1 reply

Known Participant
October 29, 2022

I saw that it was possible to do this with GREP styles. I looked on that side, but I'm stuck setting up all the different styles automatically. I don't know anything about variables. Here is a picture of what I want to do.

LaubenderCommunity ExpertCorrect answer
Community Expert
October 29, 2022

Hi @Mouchet0D4C ,

you need one GREP style for the "/10" and several for all color instances.

How many different ranges do you have? Nine ones for 1 to 9 ?

What do you mean by "I'm stuck setting up all the different styles automatically"?

Finding a GREP pattern that matches one single color range?

 

Download my sample InDesign document from my Dropbox account with instances for 1 and 2.

The GREP patterns I used are very simple ones that do work only for a range from 1 to 9 at the beginning of the expression. This one, and higher, is not supported: 10,0/10 to 10,9/10.

 

221029-1-GREP-Styles-Sample-2022.indd

https://www.dropbox.com/s/k9lfovofd57c1v9/221029-1-GREP-Styles-Sample-2022.indd?dl=1

 

Pattern for the smaller part, that is working with a "Positive Look Behind":

 

(?<=\d,\d)/10

 

 

Sample pattern for the first range from 1.0 to 1.9 :

 

1,\d/10

 

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Known Participant
November 6, 2022

Hi,

thank you very much. It works well ! 👍