Data Merge + Object Styles. Possible? Or workaround with Script?
PART ONE: Data Merge capabilities
I have a couple thousand records in a spreadsheet I'm using to create signs. Name, description, picture, fine print, etc. One of the identifiers on each sign is a colored border to visually indicate which one of five categories the sign belongs in. There are two identical signs on each page.
Is it possible to specify a value in the Data Merge source file that would set the value of a specific object's border, whether specifiying in the spreadsheet "green", "C=75 M=0 Y=100 K=10", or some other HSB/HEX/LAB color?
My guess is no, since Data Merge is basically to pull info IN, not to set values within a doc. I realize I could create an image for each of the border colors and specify the path in the Data Merge, but I'd really rather avoid that route. It makes the spreadsheet pretty clunky. Which leads me to...
PART TWO: Solving by script
If the border color can't be set during the Data Merge, my next thought was to create a script. I could include an invisible/non-printing text box to hold an imported a string value when the data merge happens (Green, Red, Orange, etc.) Write a script that would read the value on each page and set the two border objects on that page to the corresponding already-defined object style. Step and repeat for all the pages in the generated document.
I've checked out several similar threads (Here and here from 2018, and this one from 2021) which leads me to believe it's possible. Unfortunately I'm not much of a code-person. While I've downloaded VS Code, I'm struggling to piece something together because... well, I'm not a coding savant.
Anyone care to help?
