0

I have asked a similar question before, but didn't get very good results. I've looked into it a little more and I think this is the best way to tackle it. However, I'm stuck on the final part of the question, so any assistance would be gratefully received:

I am currently working on a new book which comprises a large amount of data. The data already exists in a MySQL database, and I'm fairly certain that I can import the information relatively easily into Adobe InDesign using the XML file format.

However, my problem is that each item in the database has a unique number (five digits in length). The last two digits of this number are used to colour a simple bar code as follows:

Top Row > Penultimate Digit
Second Row > Last Digit
Third Row > Penultimate Digit

The digits 0 to 9 are assigned with a specific colour and the bars are coloured accordingly. For example, the number 43256 would result in the barcode looking lik RED GREEN RED.

Does anyone know how I might be able to auotmate this process using InDesign? The database contains more than 2,500 items, and I do not want to manually go through each one and assign the colours to the barcode.

Any thoughts and comments would be most welcome.

Thanks and kind regards, Ben.

Jim Garrison
  • 85,615
  • 20
  • 155
  • 190
BenM
  • 52,573
  • 26
  • 113
  • 168
  • Is this a duplicate of this question: http://stackoverflow.com/questions/5885918/scripting-indesign-beginner ? If so, we could probably close this question as a dup. – lhan May 12 '11 at 13:29
  • An alternative is [Importing XML into InDesign](http://stackoverflow.com/a/16440964/287948). – Peter Krauss May 08 '13 at 12:47

1 Answers1

1

I think this question appears elsewhere in a different format.

You can color your text using a grep style that looks for numbers with a certain number of digits, then applies character styles automatically.

Josh Lee
  • 171,072
  • 38
  • 269
  • 275