Copy link to clipboard
Copied
Hi. I'm wondering if it's possible to have GREP Style target Text Variables in a couple of ways in order to meet some conditions.
1. In the GREP Style's To Text field, I can enter ~v for Any Variable, ~Y for Running Header (Paragraph Style), ~u for Custom Text, etc. Can these metacharacters be included in an expression to target Text Variables by name as a string? For example, a Running Header called "Name" using something like ~Y=Name or a Custom Text Variable called "Country" as ~u=Country.
Obviously, those won't work but I don't know if it's because I haven't formatted the expression properly or if it's simply impossible. Anything I've tried so far has failed.
2. Similarly, can a GREP Style target a sequence of Text Variables? Either a simple sequence like Custom+Running Paragraph+Custom (~u~Y~u) or specifically by name like (~u=Prefix~Y=Name~u=Country)?
The goal is to set up pages with conditions that these GREP styles target conditionally.
Any help is appreciated!
Copy link to clipboard
Copied
No, this is not possible with GREP and InDesign. What are you trying to do to the variables and text?
Copy link to clipboard
Copied
Thanks. I'm trying to theme sections of a document conditionally. The top margin has a text variable for displaying the author credit of the current article. I would like to style the margin's text and rule colour based on the author.
My thinking was to have distinct styles for each author and corresponding text variables. If the text variable in the top margin could have a GREP style conditional to the current author then a unique colour could be applied automatically. For example:
Without that condition the GREP Style, every text frame displays the current author's name in all colours instead of keeping the other frame content invisible.
As this isn't possible, I'm about to approach this a different way to see if I can make it work, though.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now